CN102567252A - Method and system for data transmission between hard disc and main unit - Google Patents

Method and system for data transmission between hard disc and main unit Download PDF

Info

Publication number
CN102567252A
CN102567252A CN2010105817059A CN201010581705A CN102567252A CN 102567252 A CN102567252 A CN 102567252A CN 2010105817059 A CN2010105817059 A CN 2010105817059A CN 201010581705 A CN201010581705 A CN 201010581705A CN 102567252 A CN102567252 A CN 102567252A
Authority
CN
China
Prior art keywords
sata
data
prd
host
fis
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.)
Pending
Application number
CN2010105817059A
Other languages
Chinese (zh)
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.)
BEIJING HUAHONG INTEGRATED CIRCUIT DESIGN Co Ltd
Original Assignee
BEIJING HUAHONG INTEGRATED CIRCUIT DESIGN 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 BEIJING HUAHONG INTEGRATED CIRCUIT DESIGN Co Ltd filed Critical BEIJING HUAHONG INTEGRATED CIRCUIT DESIGN Co Ltd
Priority to CN2010105817059A priority Critical patent/CN102567252A/en
Publication of CN102567252A publication Critical patent/CN102567252A/en
Pending legal-status Critical Current

Links

Images

Abstract

An embodiment of the invention discloses a method and a system for data transmission between a hard disc and a main unit. The method includes: controlling SATA (serial advanced technology attachment) DEVICE IP (internet protocol) and SATA HOST IP simultaneously by utilizing a control chip based on an SATA interface and completing encryption and decryption operations on data. Further, the requirements for safety of data transmission between the main unit and the hard disc are met and high transmission speed in case of limited resources is guaranteed by the aid of the DMA (direct memory access) transmission manner between the main unit and the SATA DEVICE IP and between the hard disc and SATA HOST IP. Meanwhile, the problem of small data buffer area is solved by circularly reading data from or writing in data into the buffer area in rated capacity, the SATA HOST IP and the SATA DEVICE IP occupies a little internal memory to complete data transmission, data processing space is saved and data transmission speed is increased.

Description

Data transmission method and system between a kind of hard disk and the main frame
Technical field
The present invention relates to communication technical field, more particularly, relate to data transmission method and system between a kind of hard disk and the main frame.
Background technology
Data transmission based on SATA agreement (a kind of serial communication protocol between hard disk and the main frame); Direct memory access DMA and first party direct memory access FPDMA relatively more commonly used; Said DMA transmission method need not handled intervention, and it is mutual that a state is carried out in order of every execution; Said FPDMA transmission method adopts local command formation NCQ technology; Can after carrying out 32 orders continuously, return a state again; Transfer rate is higher, no matter be DMA method or FPDMA method, all need set up the physical region descriptor table in host side and equipment end; Each PRD TABLE contains a plurality of PRD ITEM, and said PRDITEM is the project of the physical region descriptor PRD among the PRD TABLE.
In order to realize through hardware enciphering and deciphering data protection user profile; Need between main frame and hard disk, to increase a control chip; The function that this control chip is realized be can said main frame and hard disk between data transmission the time, carry out data encrypting and deciphering and guarantee communication security.Said DMA itself is because data write of every completion all needs the mutual of a subcommand and state, and transfer rate is lower; And said FPDMA is owing to having adopted said NCQ technology the big problem of resource to occur taking.
Thus; Existence in view of this control chip; Two kinds of transmission methods commonly used of existing said DMA and FPDMA are carrying out between main frame and hard disk also receiving the influence of said control chip in the data interaction, and resource needed is restricted; Message transmission rate can further be affected, thereby data rate problem slowly occurs.
Summary of the invention
In view of this, the present invention provides data transmission method and system between a kind of hard disk and the main frame, between realization hard disk and main frame, in the encryption and decryption functions, has improved the speed of data interaction.
Data transmission method between a kind of hard disk and the main frame; Main frame is set up with the integrated bag SATA of Serial Advanced Technology Attachment host side DEVICE IP and is communicated by letter; Hard disk is set up with the integrated bag SATA of Serial Advanced Technology Attachment equipment end HOST IP and is communicated by letter, and said SATA DEVICE IP and said SATA HOST IP all receive the control chip control based on the SATA interface:
This method comprises:
Main frame sends H2D FIS order to hard disk;
When said SATA DEVICE IP receives said H2D FIS order; The central processor CPU of said control chip based on the SATA interface is controlled said SATA DEVICE IP and is sent this H2D FIS order to said SATAHOST IP; When said SATA HOST IP received said H2D FIS order, said CPU controls said SATA DEVICE IP and said SATA HOST IP sets up physical region descriptor table PRD TABLE;
Said SATA HOST IP sends this H2D FIS order to said hard disk;
Hard disk returns the data corresponding with said H2D FIS order and status information and is forwarded to main frame by said SATA DEVICE IP to said SATA HOST IP.
This embodiment is through the DMA transmission mode between main frame and the SATA DEVICE IP; And; Adopt the DMA transmission mode between hard disk and the SATA HOST IP; And utilize said control chip to control said SATA DEVICE IP and SATA HOST IP simultaneously based on the SATA interface, and accomplish the processing and the transmission of order, data and state, realized under resource-constrained situation, can carrying out the high speed data transfer of encryption and decryption.
Preferably, said method also comprises:
Judge the type of said H2D FIS order, when said H2D FIS order is ordered command dma for direct memory access:
When said SATA DEVICE IP receives said command dma, confirm the physical region descriptor counts PRD ITEM number of maximum of the PRD TABLE of SATA DEVICEIP, be specially:
The project PRD ITEM of the PRD whether the sector count sector_count that judges said command dma can set up greater than said SATADEVICE IP counts PRD_ITEM_MAX_NUM, is specially:
As said sector_count>PRD_ITEM_MAX_NUM, then get said sector_count=sector_count-PRD_ITEM_MAX_NUM, and set up the PRD TABLE of PRD_ITEM_MAX_NUM PRD ITEM;
As said 0<sector_count<PRD_ITEM_MAX_NUM, then set up the PRD TABLE of sector_count PRD ITEM;
When said SATA HOST IP receives said command dma, confirm the PRD ITEM number of the PRD TABLE of SATA HOST IP, be specially:
Whether the sector_count that judges said command dma counts SC_MAX_NUM greater than the treatable maximum sector of said SATA HOST IP, is specially:
As said sector_count>SC_MAX_NUM, then get sector_count=sector_count-SC_MAX_NUM, and set up the PRD TABLE of SC_MAX_NUM PRD ITEM;
As said 0<sector_count<SC_MAX_NUM, then get the PRD TABLE of sector_count PRD ITEM.
Preferably, judge that said command dma is a read command DMA read command, or write order DMA WRITE order, when said command dma is DMA READ:
Said SATA HOST IP produces and interrupts when receiving the data that said hard disk sends, and deciphers to sending data based on the encryption and decryption module of the control chip of SATA interface;
With the data buffer of the data storage after the deciphering at SATA DEVICE IP;
When said SATA DEVICE IP is activated,, and the data that read are sent to main frame with reference to the PRD TABLE of the said SATA DEVICE IP that sets up data buffer circulation reading of data from said SATA DEVICE IP;
Judge the state of the PDTR register controlled position of said SATA DEVICE IP, judge according to mode bit whether the data of said SATA DEVICE IP buffer zone read and finish, and, status information STATUS FIS is sent to main frame reading when finishing;
When said command dma is DMA WRITE, when said SATA DEVICE IP receives the data that main frame writes, produces and interrupt, and encrypt to sending data based on the encryption and decryption module of the control chip of SATA interface;
Data encrypted is sent and is stored in the data buffer of SATA HOST IP;
When said SATA HOST IP is activated, according to the PRDTABLE of the said SATA HOST IP that sets up circulation reading of data and write hard disk from the data buffer of said SATA HOST IP;
Judge the state of the P1IS register controlled position DPS of said SATA HOST IP; Judging according to this mode bit whether the data of said SATA HOST IP buffer zone write finishes; And judge whether to receive status information STATUS FIS from said hard disk according to another register controlled position DHRS among the P1IS; Receive the status information STATUS FIS of hard disk transmission at said SATA HOST IP after, said STATUS FIS is forwarded to said SATA DEVICE IP;
When said SATA DEVICE IP receives this STATUS FIS; Judge the state of the PDTR register controlled position of said SATADEVICE IP; Judging according to mode bit whether the data of said SATADEVICE IP buffer zone write finishes; And, status information STATUS FIS is sent to main frame writing when finishing.
Above-mentioned embodiment is adopting circulation to read or write the method for nominal amount buffer zone; Solved the little problem in data buffer; Said SATA HOST IP and said SATA DEVICE IP utilize few internal memory; And the completion data transmission has been saved the space of data processing, has improved the transfer rate of data.
Preferably, said method also comprises: said CPU carries out initialization to said SATA HOST IP and said SATADEVICE IP, and said main frame is set up with said SATA DEVICE IP and communicated by letter, and said hard disk is set up with said SATA HOST IP and communicated by letter.
Preferably; Said method also comprises: said SATA DEVICE IP and said SATA HOST IP judge whether to receive said H2D FIS through generating interrupt status register; Be specially: when confirming to receive said H2D FIS, set up said PRD TABLE; Otherwise abandon setting up said PRD TABLE.
Preferably, said method also comprises: judge whether said SATA DEVICE IP is activated, as be activated and then receive the data that read from hard disk by said SATA HOST IP that the data of said data buffer are read in circulation, and the data that read are sent to main frame; Otherwise activate said SATA DEVICE IP.
Preferably; Said method also comprises: judge whether said SATA HOST IP is activated; As be activated and then receive the data of receiving by said SATA DEVICE IP that write from main frame, circulation is read the data of said data buffer and said data is write hard disk; Otherwise said SATA HOST IP is activated.
Above-mentioned embodiment is when between main frame and said hard disk, carrying out read-write operation, the action that required foundation communication and integrated bag activate, the perfect performance requirement of data transmission.
Data transmission system between a kind of hard disk and the main frame; Comprise: main frame, based on the control chip of SATA interface; The integrated bag SATA of Serial Advanced Technology Attachment host side DEVICE IP, the integrated bag SATA of Serial Advanced Technology Attachment equipment end HOST IP and hard disk, wherein:
Said main frame is set up with said SATA DEVICE IP and is communicated by letter, said hard disk is set up with said SATAHOST IP and communicated by letter, and said control chip based on the SATA interface is controlled said SATA DEVICEIP and said SATA HOST IP;
Said main frame sends H2D FIS order to hard disk;
When said SATA DEVICE IP receives said H2D FIS order; The central processor CPU of said control chip based on the SATA interface is controlled said SATA DEVICE IP and is sent this H2D FIS order to said SATAHOST IP; When said SATA HOST IP received said H2D FIS order, said CPU controls said SATA DEVICE IP and said SATA HOST IP sets up physical region descriptor table PRD TABLE;
Said SATA HOST IP sends this H2D FIS order to said hard disk;
Hard disk returns the data corresponding with said H2D FIS order and status information and is forwarded to main frame by said SATA DEVICE IP to said SATA HOST IP.
This System and method for is corresponding; Employing is controlled SATADEVICE IP and SATA HOST IP simultaneously based on the control chip of SATA interface; Completion is to the encryption and decryption operation of data; The DMA transmission mode is combined with third side's DMA disposal route, make data transmission security and high speed between main frame and the hard disk.
Can find out from above-mentioned technical scheme; The embodiment of the invention is controlled SATA DEVICE IP and SATA HOST IP simultaneously through adopting said control chip based on the SATA interface; Completion is to the encryption and decryption operation of data; And because the DMA transmission mode between said main frame and the SATA DEVICE IP, and, adopt the DMA transmission mode between hard disk and the SATA HOST IP; Not only satisfy the data transmission security ability requirement between main frame and the hard disk, and guaranteed high transmission speed under resource-constrained situation; Simultaneously, adopt circulation to read or write the method for nominal amount buffer zone, solved the little problem in data buffer; Said SATA HOST IP and said SATA DEVICE IP utilize few internal memory; And the completion data transmission has been saved the space of data processing, has improved the transfer rate of data.Simultaneously; The invention discloses the system corresponding with method; Said system adopts and controls SATA DEVICE IP and SATA HOST IP simultaneously based on the control chip of SATA interface; Completion combines the DMA transmission mode the encryption and decryption operation of data with third side's DMA disposal route, make data transmission security and high speed between main frame and the hard disk.
Description of drawings
In order to be illustrated more clearly in the embodiment of the invention or technical scheme of the prior art; To do to introduce simply to the accompanying drawing of required use in embodiment or the description of the Prior Art below; Obviously, the accompanying drawing in describing below only is some embodiments of the present invention, for those of ordinary skills; Under the prerequisite of not paying creative work, can also obtain other accompanying drawing according to these accompanying drawings.
Fig. 1 is a data transmission method process flow diagram between disclosed a kind of hard disk of the embodiment of the invention and the main frame;
Fig. 2 is a data transmission method process flow diagram between disclosed a kind of hard disk of the embodiment of the invention and the main frame;
Fig. 3 is a data transmission method process flow diagram between disclosed a kind of hard disk of the embodiment of the invention and the main frame;
Fig. 4 is a data transmission system structural representation between disclosed a kind of hard disk of the embodiment of the invention and the main frame.
Embodiment
For quote and know for the purpose of, the technical term that hereinafter uses, write a Chinese character in simplified form or abridge and sum up as follows:
SATA:Serial Advanced Technology Attachment, Serial Advanced Technology Attachment;
IP:Integrate Packet, integrated bag;
The integrated bag of SATA HOST IP:SATA host side;
The integrated bag of SATA DEVICE IP:SATA equipment end;
DMA:Direct Memory Access, direct memory access;
DMA READ: from the hard disk read data to host memory;
DMA WRITE: write data to hard disk from host memory;
FPDMA:First-party DMA, the direct memory access of first party;
NCQ-Native Command Queue, the local command formation;
MPDMA:Middle-party DMA, third side's direct memory access;
FIS:Fis Information Structure, the frame information structure;
PRD:Physical Region Descriptor, the physical region descriptor;
PRD TABLE: physical region descriptor table;
PRD item among the PRD ITEM:PRD TABLE;
Sector_count: sector count;
PRD_ITEM_MAX_NUM; Maximum PRD ITEM number;
SC_MAX_NUM: maximum sector number.
To combine the accompanying drawing in the embodiment of the invention below, the technical scheme in the embodiment of the invention is carried out clear, intactly description, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills are not making the every other embodiment that is obtained under the creative work prerequisite, all belong to the scope of the present invention's protection.
Data transmission method and system between a kind of hard disk and the main frame in the encryption and decryption functions, have improved the speed of data interaction between realization hard disk and main frame.
Before the description of carrying out embodiment; It should be explicitly made clear at this point: because the present invention has adopted the central processor CPU in the control chip to control SATA DEVICE IP and SATA HOST IP simultaneously; Be used to accomplish operation to the encryption and decryption of communication data; Adopted in the embodiments of the invention and do not used NCQ mechanism, to adapt to the buffer zone condition of limited under this kind application scenarios.
In an embodiment, it is pointed out that the situation that combines practical application,, adopted the SEGMENT method of not sending DMA SETUP FIS, occur with the not enough situation of PRD ITEM that adapts in the practical application at said SATA DEVICEIP end.
Send order from host side, the state after hard disk end return data and deal with data, middle this process that is experienced is in the present embodiment; Can become is MPDMA, that is, and and third side's DMA processing side; Among the embodiment in this manual; The final purpose of this MPDMA method be communication process with main frame and hard disk under the application demand of encryption and decryption, can realize high speed transmission data, and realize that main frame and the DMA of hard disk on macroscopic view transmit.
Fig. 1 shows data transmission method between a kind of hard disk and the main frame; Main frame is set up with the integrated bag SATA of Serial Advanced Technology Attachment host side DEVICE IP and is communicated by letter; Hard disk is set up with the integrated bag SATA of Serial Advanced Technology Attachment equipment end HOST IP and is communicated by letter, and said SATA DEVICE IP and said SATAHOST IP all receive the control chip control based on the SATA interface:
This method comprises:
Step 101: main frame sends H2D FIS order to hard disk;
Step 102: when said SATA DEVICE IP received said H2D FIS order, the central processor CPU of said control chip based on the SATA interface was controlled said SATA DEVICE IP and is sent this H2D FIS order to said SATA HOST IP;
Step 103: when said SATA HOST IP received said H2D FIS order, said CPU controls said SATA DEVICE IP and said SATA HOST IP sets up physical region descriptor table PRD TABLE;
Step 104: said SATA HOST IP sends this H2D FIS order to said hard disk;
Step 105: hard disk returns the data corresponding with said H2D FIS order and status information and is forwarded to main frame by said SATA DEVICE IP to said SATA HOST IP.
In the present embodiment; Through adopting said control chip to control SATADEVICE IP and SATA HOST IP simultaneously based on the SATA interface, accomplish encryption and decryption operation to data, and because the DMA transmission mode between said main frame and the SATA DEVICE IP; And; Adopt the DMA transmission mode between hard disk and the SATA HOSTIP, not only satisfied the data transmission security ability requirement between main frame and the hard disk, and guaranteed high transmission speed under resource-constrained situation.
Fig. 2 shows data transmission method between another hard disk and the main frame, and under the application scenarios based on Fig. 1, what this embodiment embodied a concentrated reflection of is that main frame adopts data processing method of the present invention when reading hard disk, comprising:
Step 201: main frame sends H2D FIS order to hard disk;
Step 202: when said SATA DEVICE IP receives said H2D FIS order; Judge the type of said H2D FIS order; If said H2D FIS order is provided with order or PIO order for attribute; Then this H2D FIS order is forwarded to hard disk by said SATA HOST IP, and by hard disk to main frame return data and status information;
When said H2D FIS order is ordered command dma for direct memory access, execution in step 203;
Step 203: when said command dma is the DMA read command, this order is sent to SATA HOST IP by said SATADEVICE IP;
This step is specially:
For said SATA DEVICE IP: the project PRDITEM of the PRD whether the sector count sector_count that at first judges said command dma can set up greater than said SATA DEVICE IP counts PRD_ITEM_MAX_NUM, is specially:
As said sector_count>PRD_ITEM_MAX_NUM, then get said sector_count=sector_count-PRD_ITEM_MAX_NUM, and set up the PRD TABLE of PRD_ITEM_MAX_NUM PRD ITEM;
As said 0<sector_count<PRD_ITEM_MAX_NUM, then set up the PRD TABLE of sector_count PRD ITEM;
For said SATA HOST IP: when said SATA HOST IP receives said command dma, confirm the PRD ITEM number of the PRD TABLE of SATA HOST IP, be specially:
Whether the sector_count that judges said command dma counts SC_MAX_NUM greater than the treatable maximum sector of said SATA HOST IP, is specially:
As said sector_count>SC_MAX_NUM, then get sector_count=sector_count-SC_MAX_NUM, and set up the PRD TABLE of SC_MAX_NUM PRD ITEM;
As said 0<sector_count<SC_MAX_NUM, then get the PRD TABLE of sector_count PRD ITEM.
Step 204: the PRD ITEM number according to confirming is forwarded to hard disk with said order by said SATA HOST IP;
Step 205: said hard disk sends the data corresponding with this DMA read command to said SATAHOST IP;
Step 206: said SATA HOST IP produces interruption under the control of CPU, and sends data to the encryption and decryption module of said control chip based on the SATA interface;
Step 207: after said encryption and decryption module is deciphered data, be stored to the data buffer of SATA DEVICE IP;
Step 208: judge whether SATA DEVICE IP is activated, as be activated and carry out step 209;
Step 209:, and the data that read are sent to main frame with reference to the PRD TABLE of the said SATA DEVICE IP that sets up data buffer circulation reading of data from said SATA DEVICE IP; Otherwise activate said SATA DEVICE IP, carry out said step 209;
In this simultaneously, judge that whether sector_count counts SC_MAX_NUM greater than the treatable maximum sector of said SATA HOST IP, is specially:
As said sector_count>SC_MAX_NUM; Then get sector_count=sector_count-SC_MAX_NUM; And set up the PRD TABLE of SC_MAX_NUM PRD ITEM, and count the circulation reading of data by the PRD ITEM after confirming, until said 0<sector<SC_MAX_NUM;
As said 0<sector_count<SC_MAX_NUM, then get the PRD TABLE of sector_count PRD ITEM and count reading of data by the PRD ITEM after confirming;
Step 210: said SATA DEVICE IP receives the data of said SATA HOST IP; And data are sent to after main frame finishes; The PISR register of said SATA DEVICE IP can produce interruption, and wherein the DPS position among the PISR is put 1, and the DPP in the PCMDR register can be put 1 simultaneously;
Judge whether the b0 position in the PDTR register is 0, if 0, then execution in step 211; If the b0 position is not 0 in the said PDTR register,, continue to wait for by decrypted data then with the DPS position of interrupt register PISR and the DPP position 0 among the control register PCMDR.
Step 211: the data among PRD_ITEM_MAX_NUM the PRDITEM of said SATA DEVICE IP are end of transmission; Read in the status information that finishes to the main frame transmission; And can judge that whether sector_count is greater than PRD_ITEM_MAX_NUM; If sector_count>PRD_ITEM_MAX_NUM, then step 203-step 210 is carried out in circulation; If the b0 position is not 0 in the said PDTR register,, continue to wait for by decrypted data then with the DPS position of interrupt register PISR and the DPP position 0 among the control register PCMDR.
In the present embodiment; The method that adopts circulation to read the nominal amount buffer zone realized from hard disk to SATAHOST IP, and said SATA DEVICE IP carries out the judgement of the relevant control bit of register when receiving the data that said SATA HOST IP sends; And the buffer zone that said SATA HOST IP and said SATADEVICE IP respectively have nominal amount is used to set up PRD TABLE; In the practical application, said SATA DEVICE IP can make up PRD_ITEM_MAX_NUM PRD ITEM, and the PRD ITEM that SATA HOST IP makes up is slightly less than PRD_ITEM_MAX_NUM; Because after a PRD ITEM is processed; DPP position in the PCMDR register of said SATA DEVICE IP can be put 1, can hang up all activities like this, until this position by zero clearing.
Fig. 3 shows data transmission method between a kind of hard disk and the main frame, and under the application scenarios based on Fig. 1, this embodiment embodies a concentrated reflection of and is, when hard disk writes data, adopts data processing method of the present invention at main frame, comprising:
Step 301: main frame sends H2D FIS order to hard disk;
Step 302: when said SATA DEVICE IP receives said H2D FIS order; Judge the type of said H2D FIS order; If said H2D FIS order is provided with order or PIO order for attribute; Then this H2D FIS order is forwarded to hard disk by said SATA HOST IP, and by hard disk to main frame return data and status information;
When said H2D FIS order is ordered command dma for direct memory access, execution in step 303;
Step 303: when said command dma is ordered for DMA WRITE, this order is sent to SATA HOST IP by said SATADEVICE IP;
This step is specially:
For said SATA DEVICE IP: the project PRDITEM of the PRD whether the sector count sector_count that at first judges said command dma can set up greater than said SATA DEVICE IP counts PRD_ITEM_MAX_NUM, is specially:
As said sector_count>PRD_ITEM_MAX_NUM, then get said sector_count=sector_count-PRD_ITEM_MAX_NUM, and set up the PRD TABLE of PRD_ITEM_MAX_NUM PRD ITEM;
As said 0<sector_count<PRD_ITEM_MAX_NUM, then set up the PRD TABLE of sector_count PRD ITEM;
For said SATA HOST IP: when said SATA HOST IP receives said command dma, confirm the sector number of the PRD TABLE of SATA HOST IP, be specially:
Whether the sector_count that judges said command dma counts SC_MAX_NUM greater than the treatable maximum sector of said SATA HOST IP, is specially:
As said sector_count>SC_MAX_NUM, then get sector_count=sector_count-SC_MAX_NUM, and set up the PRD TABLE of SC_MAX_NUM PRD ITEM;
As said 0<sector_count<SC_MAX_NUM, then get the PRD TABLE of sector_count PRD ITEM.
Step 304: judgement receives this DMA ACTIVEFIS to said SATA HOST IP according to register, transfers to main frame through said SATA HOST IP.
Step 305: the data that said main frame will write are sent among the said SATA DEVICE IP;
Step 306: when said SATA DEVICE IP receives the data that main frame writes, produce and interrupt, and encrypt to sending data based on the encryption and decryption module of the control chip of SATA interface;
Step 307: the data buffer of data encrypted being sent and being stored in SATA HOST IP;
Step 308: judge whether said SATA HOST IP is activated, as be activated execution in step 309;
Step 309:, otherwise activate said SATAHOST IP, execution in step 309 according to the PRD TABLE of the said SATA HOST IP that sets up circulation reading of data and write hard disk from the data buffer of said SATAHOST IP;
Meanwhile; When judging whether sector_count>SC_MAX_NUM; Confirm the PRD ITEM number of the PRD TABLE of said SATAHOST IP, and write data, until said 0<sector_count<SC_MAX_NUM according to the PRD ITEM number circulation after confirming;
When 0<sector_count<SC_MAX_NUM, then get the PRD TABLE of sector_count PRD ITEM and write data by the PRD ITEM number after confirming;
Step 310: judge whether the b0 position in the PDTR register is 0; If 0; Data among the then said SATADEVICE IPPRD_ITEM_MAX_NUM PRD ITEM are end of transmission, sends to main frame and writes the status information that finishes, and can judge that whether sector_count is greater than PRD_ITEM_MAX_NUM; If sector_count>PRD_ITEM_MAX_NUM, then step 303-step 310 is carried out in circulation; If the b0 position is not 0 in the said PDTR register,, continue to wait for encrypted data then with the DPS position of interrupt register PISR and the DPP position 0 among the control register PCMDR.
Need to prove:
Whether the b0 position in judging the PDTR register is before 0; Also to judge the state of the P1IS register controlled position DPS of said SATAHOST IP; Judge according to this mode bit whether the data of said SATAHOST IP buffer zone write and finish, and judge whether to receive status information STATUS FIS from said hard disk according to another register controlled position DHRS among the P1IS.
Receive the status information STATUS FIS of hard disk transmission at SATA HOST IP after, forward it to SATA DEVICE IP, be sent to main frame by SATA DEVICE IP again.
It is the process that data is write hard disk from said main frame that present embodiment embodies; The explanation corresponding with Fig. 2 is similar; Mode bit when size through judging buffer zone when writing data and status information are sent is judged; Guaranteed that buffer zone makes full use of the high-efficiency transfer with data when carrying out write order.
Above-mentioned two embodiment have enumerated out and have carried out the process that pass down the line, reading and writing data, status information are uploaded between hard disk and the main frame; Used the data transmission method among the present invention; On the core concept based on corresponding diagram of Fig. 1 of this instructions and explanation; Not only realized carrying out requirement and the high speed property when having guaranteed of the security performance of data encrypting and deciphering, solved the little problem in data buffer in data processing at said hard disk and main frame.
Fig. 4 shows data transmission system between a kind of hard disk and the main frame, comprising:
Main frame 401, based on the control chip 402 of SATA interface, the integrated bag SATA of Serial Advanced Technology Attachment host side DEVICE IP403, Serial Advanced Technology Attachment equipment end integrated bag SATA HOSTIP404 and hard disk 405, wherein:
Said main frame 401 is set up with said SATA DEVICE IP403 and is communicated by letter, said hard disk 405 is set up with said SATA HOST IP404 and communicated by letter, said control chip 402 said SATA DEVICE IP403 of control and said SATA HOST IP404 based on the SATA interface;
Said main frame 401 sends H2D FIS order to hard disk 405;
When said SATA DEVICE IP403 receives said H2D FIS order; The central processor CPU of said control chip 402 based on the SATA interface is controlled said SATA DEVICE IP and is sent this H2D FIS order to said SATA HOST IP404; When said SATA HOST IP404 received said H2D FIS order, said CPU controls said SATA DEVICE IP403 and said SATA HOST IP404 sets up physical region descriptor table PRD TABLE;
Said SATA HOST IP404 sends this H2D FIS order to said hard disk 405;
Hard disk 405 returns the data corresponding with said H2D FIS order and status information and is forwarded to main frame 401 by said SATA DEVICE IP403 to said SATA HOST IP404.
This System and method for is corresponding; Employing is controlled SATADEVICE IP and SATA HOST IP simultaneously based on the control chip of SATA interface; Completion is to the encryption and decryption operation of data; The DMA transmission mode is combined with third side's DMA disposal route, make data transmission security and high speed between main frame and the hard disk.
In sum:
Embodiments of the invention are controlled SATA DEVICE IP and SATA HOST IP simultaneously through adopting said control chip based on the SATA interface; Completion is to the encryption and decryption operation of data; And because the DMA transmission mode between said main frame and the SATA DEVICE IP, and, adopt the DMA transmission mode between hard disk and the SATAHOST IP; Not only satisfy the data transmission security ability requirement between main frame and the hard disk, and guaranteed high transmission speed under resource-constrained situation; Simultaneously, adopt circulation to read or write the method for nominal amount buffer zone, solved the little problem in data buffer; Said SATAHOST IP and said SATA DEVICE IP utilize few internal memory; And the completion data transmission has been saved the space of data processing, has improved the transfer rate of data.Simultaneously; The invention discloses the system corresponding with method; Said system adopts and controls SATA DEVICE IP and SATA HOST IP simultaneously based on the control chip of SATA interface; Completion combines the DMA transmission mode the encryption and decryption operation of data with third side's DMA disposal route, make data transmission security and high speed between main frame and the hard disk.
Each embodiment adopts the mode of going forward one by one to describe in this instructions, and what each embodiment stressed all is and the difference of other embodiment that identical similar part is mutually referring to getting final product between each embodiment.For the disclosed system of embodiment, because it is corresponding with the embodiment disclosed method, so description is fairly simple, relevant part is partly explained referring to method and is got final product.
The professional can also further recognize; The unit and the algorithm steps of each example of describing in conjunction with embodiment disclosed herein; Can realize with electronic hardware, computer software or the combination of the two; For the interchangeability of hardware and software clearly is described, the composition and the step of each example described prevailingly according to function in above-mentioned explanation.These functions still are that software mode is carried out with hardware actually, depend on the application-specific and the design constraint of technical scheme.The professional and technical personnel can use distinct methods to realize described function to each certain applications, but this realization should not thought and exceeds scope of the present invention.
To the above-mentioned explanation of the disclosed embodiments, make this area professional and technical personnel can realize or use the present invention.Multiple modification to these embodiment will be conspicuous concerning those skilled in the art, and defined General Principle can realize under the situation that does not break away from the spirit or scope of the present invention in other embodiments among this paper.Therefore, the present invention will can not be restricted to these embodiment shown in this paper, but will meet and principle disclosed herein and features of novelty the wideest corresponding to scope.

Claims (8)

1. data transmission method between hard disk and the main frame; It is characterized in that; Main frame is set up with the integrated bag SATA of Serial Advanced Technology Attachment host side DEVICE IP and is communicated by letter; Hard disk is set up with the integrated bag SATA of Serial Advanced Technology Attachment equipment end HOST IP and is communicated by letter, and said SATA DEVICE IP and said SATAHOST IP all receive the control chip control based on the SATA interface, and this method comprises:
Main frame sends H2D FIS order to hard disk;
When said SATA DEVICE IP receives said H2D FIS order; The central processor CPU of said control chip based on the SATA interface is controlled said SATA DEVICE IP and is sent this H2D FIS order to said SATAHOST IP; When said SATA HOST IP received said H2D FIS order, said CPU controls said SATA DEVICE IP and said SATA HOST IP sets up physical region descriptor table PRD TABLE;
Said SATA HOST IP sends this H2D FIS order to said hard disk;
Hard disk returns the data corresponding with said H2D FIS order and status information and is forwarded to main frame by said SATA DEVICE IP to said SATA HOST IP.
2. transmission method according to claim 1 is characterized in that, also comprises:
Judge the type of said H2D FIS order, when said H2D FIS order is ordered command dma for direct memory access:
When said SATA DEVICE IP receives said command dma, confirm the physical region descriptor counts PRD ITEM number of maximum of the PRD TABLE of SATA DEVICEIP, be specially:
The project PRD ITEM of the PRD whether the sector count sector_count that judges said command dma can set up greater than said SATADEVICE IP counts PRD_ITEM_MAX_NUM, is specially:
As said sector_count>PRD_ITEM_MAX_NUM, then get said sector_count=sector_count-PRD_ITEM_MAX_NUM, and set up the PRD TABLE of PRD_ITEM_MAX_NUM PRD ITEM;
As said 0<sector_count<PRD_ITEM_MAX_NUM, then set up the PRD TABLE of sector_count PRD ITEM;
When said SATA HOST IP receives said command dma, confirm the PRD ITEM number of the PRD TABLE of SATA HOST IP, be specially:
Whether the sector_count that judges said command dma counts SC_MAX_NUM greater than the treatable maximum sector of said SATA HOST IP, is specially:
As said sector_count>SC_MAX_NUM, then get sector_count=sector_count-SC_MAX_NUM, and set up the PRD TABLE of SC_MAX_NUM PRD ITEM;
As said 0<sector_count<SC_MAX_NUM, then get the PRD TABLE of sector_count PRD ITEM.
3. method according to claim 2 is characterized in that, judges that said command dma is a read command DMA read command, or write order DMA WRITE order, when said command dma is DMA READ:
Said SATA HOST IP produces and interrupts when receiving the data that said hard disk sends, and deciphers to sending data based on the encryption and decryption module of the control chip of SATA interface;
With the data buffer of the data storage after the deciphering at said SATA DEVICE IP;
When said SATA DEVICE IP is activated,, and the data that read are sent to main frame with reference to the PRD TABLE of the said SATA DEVICE IP that sets up data buffer circulation reading of data from said SATA DEVICE IP;
Judge the state of the PDTR register controlled position of said SATA DEVICE IP, judge according to mode bit whether the data of said SATA DEVICE IP buffer zone read and finish, and, status information STATUS FIS is sent to main frame reading when finishing;
When said command dma is DMA WRITE, when said SATA DEVICE IP receives the data that main frame writes, produces and interrupt, and encrypt to sending data based on the encryption and decryption module of the control chip of SATA interface;
Data encrypted is sent and is stored in the data buffer of SATA HOST IP;
When said SATA HOST IP is activated, according to the PRDTABLE of the said SATA HOST IP that sets up circulation reading of data and write hard disk from the data buffer of said SATA HOST IP;
Judge the state of the P1IS register controlled position DPS of said SATA HOST IP; Judging according to this mode bit whether the data of said SATA HOST IP buffer zone write finishes; And judge whether to receive status information STATUS FIS from said hard disk according to another register controlled position DHRS among the P1IS; Receive the status information STATUS FIS of hard disk transmission at said SATA HOST IP after, said STATUS FIS is forwarded to said SATA DEVICE IP;
When said SATA DEVICE IP receives this STATUS FIS; Judge the state of the PDTR register controlled position of said SATADEVICE IP; Judging according to mode bit whether the data of said SATADEVICE IP buffer zone write finishes; And, status information STATUS FIS is sent to main frame writing when finishing.
4. method according to claim 1; It is characterized in that; Also comprise: said CPU carries out initialization to said SATA HOST IP and said SATA DEVICE IP, and said main frame is set up with said SATA DEVICE IP and communicated by letter, and said hard disk is set up with said SATA HOST IP and communicated by letter.
5. method according to claim 1; It is characterized in that; Also comprise: said SATA DEVICEIP and said SATA HOST IP judge whether to receive said H2DFIS through generating interrupt status register; Be specially: when confirming to receive said H2D FIS, set up said PRD TABLE; Otherwise abandon setting up said PRD TABLE.
6. method according to claim 3; It is characterized in that, also comprise: judge whether said SATADEVICE IP is activated, as be activated and then receive the data that read from hard disk by said SATA HOST IP; The data of said data buffer are read in circulation, and the data that read are sent to main frame; Otherwise activate said SATA DEVICE IP.
7. method according to claim 3; It is characterized in that; Also comprise: judge whether said SATAHOST IP is activated; As be activated and then receive the data of receiving by said SATA DEVICE IP that write from main frame, circulation is read the data of said data buffer and said data is write hard disk; Otherwise said SATA HOST IP is activated.
8. data transmission system between hard disk and the main frame; It is characterized in that; Comprise: main frame, based on the control chip of SATA interface, the integrated bag SATA of Serial Advanced Technology Attachment host side DEVICE IP, the integrated bag SATA of Serial Advanced Technology Attachment equipment end HOST IP and hard disk, wherein:
Said main frame is set up with said SATA DEVICE IP and is communicated by letter, said hard disk is set up with said SATAHOST IP and communicated by letter, and said control chip based on the SATA interface is controlled said SATA DEVICEIP and said SATA HOST IP;
Said main frame sends H2D FIS order to hard disk;
When said SATA DEVICE IP receives said H2D FIS order; The central processor CPU of said control chip based on the SATA interface is controlled said SATA DEVICE IP and is sent this H2D FIS order to said SATAHOST IP; When said SATA HOST IP received said H2D FIS order, said CPU controls said SATA DEVICE IP and said SATA HOST IP sets up physical region descriptor table PRD TABLE;
Said SATA HOST IP sends this H2D FIS order to said hard disk;
Hard disk returns the data corresponding with said H2D FIS order and status information and is forwarded to main frame by said SATA DEVICE IP to said SATA HOST IP.
CN2010105817059A 2010-12-09 2010-12-09 Method and system for data transmission between hard disc and main unit Pending CN102567252A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2010105817059A CN102567252A (en) 2010-12-09 2010-12-09 Method and system for data transmission between hard disc and main unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2010105817059A CN102567252A (en) 2010-12-09 2010-12-09 Method and system for data transmission between hard disc and main unit

Publications (1)

Publication Number Publication Date
CN102567252A true CN102567252A (en) 2012-07-11

Family

ID=46412703

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2010105817059A Pending CN102567252A (en) 2010-12-09 2010-12-09 Method and system for data transmission between hard disc and main unit

Country Status (1)

Country Link
CN (1) CN102567252A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103345453A (en) * 2013-06-27 2013-10-09 清华大学 Hard disk data encryption card supporting SATA interface and encryption and decryption method
CN105279107A (en) * 2015-11-13 2016-01-27 北京华虹集成电路设计有限责任公司 Disk start-up prevention method and system
CN105468983A (en) * 2015-11-17 2016-04-06 北京华虹集成电路设计有限责任公司 Data transmission method and device based on SATA (Serial Advanced Technology Attachment) interface
CN105550605A (en) * 2015-12-16 2016-05-04 北京华虹集成电路设计有限责任公司 Encryption/decryption engine and implementation method thereof
CN106095713A (en) * 2016-06-06 2016-11-09 深圳市硅格半导体股份有限公司 Message communication method and device
CN107145198A (en) * 2017-04-19 2017-09-08 深圳市同泰怡信息技术有限公司 A kind of method and its mainboard for lifting server to hard disk compatibility
CN114721984A (en) * 2022-03-30 2022-07-08 湖南长城银河科技有限公司 SATA interface data transmission method and system for low-delay application
WO2023160639A1 (en) * 2022-02-24 2023-08-31 华为技术有限公司 Data processing method, direct memory access engine and computing device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060117189A1 (en) * 2000-11-03 2006-06-01 Chung-Yen Chiu Cryptographic serial ATA apparatus and method
US20070260756A1 (en) * 2006-01-05 2007-11-08 Pao-Ching Tseng Method for Processing Command via SATA Interface
US20090234994A1 (en) * 2008-03-14 2009-09-17 Kyutaeg Oh Method, apparatus, and system for port multiplier enhancement
CN101800071A (en) * 2009-02-10 2010-08-11 三星电子株式会社 Solid state disk device and program fail processing method thereof
CN101840306A (en) * 2009-03-18 2010-09-22 研祥智能科技股份有限公司 Method and system for driving SATA (Serial Advanced Technology Attachment) device in VxWorks operating system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060117189A1 (en) * 2000-11-03 2006-06-01 Chung-Yen Chiu Cryptographic serial ATA apparatus and method
US20070260756A1 (en) * 2006-01-05 2007-11-08 Pao-Ching Tseng Method for Processing Command via SATA Interface
US20090234994A1 (en) * 2008-03-14 2009-09-17 Kyutaeg Oh Method, apparatus, and system for port multiplier enhancement
CN101800071A (en) * 2009-02-10 2010-08-11 三星电子株式会社 Solid state disk device and program fail processing method thereof
CN101840306A (en) * 2009-03-18 2010-09-22 研祥智能科技股份有限公司 Method and system for driving SATA (Serial Advanced Technology Attachment) device in VxWorks operating system

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103345453A (en) * 2013-06-27 2013-10-09 清华大学 Hard disk data encryption card supporting SATA interface and encryption and decryption method
CN103345453B (en) * 2013-06-27 2016-02-24 清华大学 Based on supporting the method that the fixed disk data enciphering card of SATA interface is encrypted
CN105279107A (en) * 2015-11-13 2016-01-27 北京华虹集成电路设计有限责任公司 Disk start-up prevention method and system
CN105468983A (en) * 2015-11-17 2016-04-06 北京华虹集成电路设计有限责任公司 Data transmission method and device based on SATA (Serial Advanced Technology Attachment) interface
CN105468983B (en) * 2015-11-17 2020-01-03 北京华大智宝电子系统有限公司 Data transmission method and device based on SATA interface
CN105550605A (en) * 2015-12-16 2016-05-04 北京华虹集成电路设计有限责任公司 Encryption/decryption engine and implementation method thereof
CN106095713A (en) * 2016-06-06 2016-11-09 深圳市硅格半导体股份有限公司 Message communication method and device
CN107145198A (en) * 2017-04-19 2017-09-08 深圳市同泰怡信息技术有限公司 A kind of method and its mainboard for lifting server to hard disk compatibility
CN107145198B (en) * 2017-04-19 2020-04-17 深圳市同泰怡信息技术有限公司 Method for improving compatibility of server to hard disk and mainboard thereof
WO2023160639A1 (en) * 2022-02-24 2023-08-31 华为技术有限公司 Data processing method, direct memory access engine and computing device
CN114721984A (en) * 2022-03-30 2022-07-08 湖南长城银河科技有限公司 SATA interface data transmission method and system for low-delay application

Similar Documents

Publication Publication Date Title
CN102567252A (en) Method and system for data transmission between hard disc and main unit
US8321659B2 (en) Data encryption apparatus, data decryption apparatus, data encryption method, data decryption method, and data transfer controlling apparatus
JP4698982B2 (en) Storage system that performs cryptographic processing
EP2803012B1 (en) Using storage controller bus interfaces to secure data transfer between storage devices and hosts
CN110618947A (en) Techniques for secure I/O with memory encryption engine
US9076003B2 (en) Method and apparatus for transparently encrypting and decrypting computer interface data
CN103345453B (en) Based on supporting the method that the fixed disk data enciphering card of SATA interface is encrypted
CN100437618C (en) Portable information safety device
US7320071B1 (en) Secure universal serial bus
CN104217180B (en) A kind of encryption storage dish
JP2008269363A (en) Storage controller and storage control method
WO2006131069A1 (en) A separate encryption/decryption equipment for plentiful data and a implementing method thereof
CN200994141Y (en) Network encryption card with PCI interface
JP2014530371A (en) File encryption method and apparatus, file decryption method and apparatus
CN101308475A (en) Safe mobile storage system and method of use thereof
CN101872334A (en) Compound type usb equipment and implementation method thereof
KR100954649B1 (en) Data encryption apparatus, data decryption apparatus and data encryption method
CN101561751A (en) USB encryption and decryption bridging chip
CN106326757A (en) Data encryption device of storage system
CN105468983A (en) Data transmission method and device based on SATA (Serial Advanced Technology Attachment) interface
CN105472030A (en) Remote mirror image method and system based on iSCSI
CN115237843B (en) Trusted computing system and method
CN103390135A (en) File protection system and implement method thereof
CN104268489A (en) Method for optimizing performance of encryption card based on DEVICE MAPPER
CN100517290C (en) Method for realizing universal series bus key compound equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
AD01 Patent right deemed abandoned

Effective date of abandoning: 20120711

C20 Patent right or utility model deemed to be abandoned or is abandoned