Home Tekniikka Varastointijärjestelmä

Varastointijärjestelmä



Esittely

Tallennusjärjestelmä on yksi tärkeimmistä tietokoneen osista. Tallennusjärjestelmä tarjoaa mahdollisuuden kirjoittaa ja lukea tietoja (ohjelmia ja tietoja), joita tietokone tarvitsee saavuttaakseen tietokoneen nykyaikaisen tietomuistitoiminnon. kohtujärjestelmät.

Thecoreofacomputerstoragesystemismemory,whichisanindispensablememorydeviceusedtostoreprogramsanddatainacomputer.

Sisäinen muisti (muisti lyhyt) tallentaa pääasiassa ohjelmia ja tietoja, joita tietokone tarvitsee nykyiseen työhön, mukaan lukien nopea välimuisti (välimuisti, lyhyt välimuisti) ja päämuisti. Tällä hetkellä muistin pääkomponentti onpuolijohdemuisti.Ulkoinentallennusmuistin magneettitallennus, optinen tallennus ja puolijohdemuisti. Tallennusvälineisiin kuuluvat kiintolevyt, optiset levyt, nauhat ja mobiilimuisti.

Themulti-levelstoragearchitectureofmoderncomputersystemsisshowninFigure6-1.Thehigherthetop,theclosertotheCPU,thefasterthememory,thesmallerthecapacity,andthehigherthepriceperbit.Usingthisorganizationmethodcanbettersolvethecontradictionbetweenstoragecapacity,speedandcost,andprovidealayerofstoragethatislogicallyequivalenttothecheapestinpriceandcapacity,andtheaccessspeedisclosetothefastestinthestoragesystem.Storagesystemoflayeredmemory.

Development

Ifthecomputer'sexternalstoragesystemhasbeendevelopedsince1956whenIBMproducedthefirstharddisk,ithasbeendevelopedformorethanhalfacentury.Inthepasthalfcentury,storagemediaandstoragesystemshaveachievedgreatdevelopmentandprogress.

Intheearlydaysofdatastorage,devicessuchasdiskarraysweregenerallyusedasperipherals,andtheserversweredirectlyconnectedforstorage.Inrecentyears,withthedevelopmentofnetworktechnology,thedatareadingrangeoftheserverhasalsobeengreatlyexpanded,graduallyrealizingthecurrentnetworkstorage.Comparedwithtraditionalstorage,theadvantagesofnetworkstoragearemoreprominent.Itisnotonlyconvenienttoinstallandlowincost,butalsoabletoexpandstoragedevicesonalargescale,thuseffectivelymeetingthestoragespacerequirementsofmassivedatastorage.However,networkstorageconsumesalotofnetworkresources,whichisadifficultproblem.Forthisreason,SANstoragearchitecturegraduallyappeared.

Perinteinen tallennusjärjestelmä

Tällä hetkellä perinteisiä tallennusjärjestelmiä on kolme arkkitehtuuria, mukaan lukien DAS, NAS ja SAN.

1.DAS (Direct-AttachedStorage,Direct-AttachedStorage)

Asthenameimplies,thisisastoragemethodinwhichstoragemediasuchasharddisksaredirectlyconnectedtothehostthroughabusadapter.Thereisusuallynonetworkequipmentinvolvedbetweenthestoragedeviceandthehost.ItcanbesaidthatDASisthemostprimitiveandbasicstoragearchitecture,anditisalsothemostcommononpersonalcomputersandservers.TheadvantagesofDASareitssimplestructure,lowcost,andhighefficiencyofreadingandwriting.Thedisadvantageisthatithaslimitedcapacityandisdifficulttoshare,whichmakesiteasytoform"informationislands."

2.NAS (verkkoon liitetty tallennus, verkkotallennusjärjestelmä)

NASisanetworkstoragesystemthatprovidesfile-levelaccessinterfaces,usuallyusingnetworkfilessuchasNFS,SMB/CIFS,etc.Sharingagreementforfileaccess.NASsupportssimultaneousaccessbymultipleclientsandprovidesalarge-capacitycentralizedstoragefortheserver,whichalsofacilitatesdatasharingduringtheserviceperiod.

3.SAN (StorageAreaNetwork, Storageareannetwork)

Setupadedicatedstoragenetworkbetweenserversandstoragedevicessuchasdiskarraysthroughhigh-speednetworkequipmentsuchasfiberswitchestoprovidehighperformanceStoragesystem.

ThedifferencebetweenSANandNASisthatitprovidesablock-levelaccessinterface,andgenerallydoesnotprovideafilesystematthesametime.Undernormalcircumstances,theserverneedstomaptheSANstoragetoalocaldiskthroughanaccessprotocolsuchasSCSI,anduseitaftercreatingafilesystemonit.Atpresent,mainstreamenterprise-levelNASorSANstorageproductscangenerallyprovideTB-levelstoragecapacity,andhigh-endstorageproductscanalsoprovideuptoseveralpetabytesofstoragecapacity.

Distributedstoragesystem

Bigdatahasledtoanexplosivegrowthintheamountofdata.Traditionalcentralizedstorage(suchasNASorSAN)can’tperformwellintermsofcapacityandperformance.Meettheneedsofbigdata.Therefore,distributedstoragewithexcellentscalabilityhasbecomethemainstreamarchitectureforbigdatastorage.Distributedstoragemostlyusesordinaryhardwareequipmentastheinfrastructure,sothestoragecostperunitcapacityisalsogreatlyreduced.Inaddition,distributedstoragealsohasdifferentdegreesofadvantagesintermsofperformance,maintainability,anddisastertolerance.

Thekeytechnicalissuesthatadistributedstoragesystemneedstosolveincludescalability,dataredundancy,dataconsistency,globalnamespacecaching,etc.Fromanarchitecturalpointofview,distributedstoragecanbedividedintoTherearetwotypes:C/S(ClientServer)architectureandP2P(Peer-to-Peer)architecture.Ofcourse,therearealsosomedistributedstoragesystemswherethesetwoarchitecturesexistatthesametime.

Anothercommonproblemfacedbydistributedstorageishowtoorganizeandmanagemembernodes,andhowtoestablishthemappingrelationshipbetweendataandnodes.Thedynamicincreaseordepartureofmembernodescanbasicallyberegardedasanormalstateinadistributedsystem.

TheCAPtheoryofdistributedsystemdesignproposedbyEricBrewerin2000pointedoutthatadistributedsystemcannotguaranteethethreeelementsofconsistency,availability,andpartitiontoleranceatthesametime.Therefore,anydistributedstoragesystemcanonlyoptimizetwoofitselementstothegreatestextentbasedonitsspecificbusinesscharacteristicsandspecificneeds.Ofcourse,inadditiontothethreedimensionsofconsistency,availability,andpartitiontolerance,adistributedstoragesystemoftenhasdifferenttrade-offsinfeaturedesignaccordingtospecificservices,suchaswhetheritneedsacachemoduleandwhetheritsupportscommonfiles.Systeminterface,etc.

Cloudstorage

Cloudstorageisanonlinestoragesystemprovidedbythird-partyoperators,suchasonlinestoragesystemsforindividualusersandfile,blockorobjectstoragesystemsforenterprises,etc..Cloudstorageoperatorsareresponsibleforthedeployment,operation,andmaintenanceofdatacenters,andprovidedatastoragepackagestocustomersintheformofservices.Asoneoftheextensionsandimportantcomponentsofcloudcomputing,cloudstorageprovidesdatastorageservicesof"distributionondemandandbillingbyvolume".Therefore,usersofcloudstoragedonotneedtobuildtheirowndatacentersandinfrastructure,nordotheyneedtocareaboutthemanagementandmaintenanceoftheunderlyingstoragesystem,andcandynamicallyexpandorreducetheirdemandforstoragecapacityaccordingtotheirbusinessneeds.

Cloudstorageusesoperatorstocentrallyanduniformlydeployandmanagestoragesystems,whichreducesthecostofdatastorage,therebyloweringthebarrierstoentryforthebigdataindustry,andhelpingsmallandmedium-sizedenterprisestoenterthebigdataindustry.Providespossibilities.Forexample,thewell-knownonlinefilestorageserviceproviderDropboxisbasedontheonlinestoragesystemS3providedbyAWS(AmazonWebServices).Beforetheriseofcloudstorage,itwasalmostimpossibletostartastartuplikeDropbox.

Thestoragesystemsusedbehindcloudstorageactuallymostlyusedistributedarchitecture,andcloudstoragehasalsoencounterednewproblemsandrequirementsindesignduetoitsmorenewapplicationscenarios.Forexample,cloudstoragemostlyneedstosolvehowtosupportmulti-tenantaccessinthemanagementsystemandaccessinterface.Inamulti-tenantenvironment,itisinevitabletosolveaseriesofproblemssuchassecurityandperformanceisolation.Inaddition,cloudstorageisthesameascloudcomputing.Acommonproblemthatneedstobesolvedistheissueoftrust—howtotechnicallyensuretheprivacyandsecurityofenterprisebusinessdataonthethird-partystorageserviceproviderplatform.Itisatechnicalchallengethatmustbesolved.

Storageisprovidedtousersintheformofservices,andcloudstoragegenerallyadherestothecharacteristicsofsimplicityandeaseofuseintheaccessinterface.Forexample,Amazon'sS3storageaccessesdatathroughastandardHTTPprotocolandasimpleRESTinterface.UsersuseHTTPmethodssuchasGet,Put,andDeletetoobtain,store,anddeletedatablocks.Forthesakeofeaseofoperation,AmazonS3servicedoesnotprovideoperationssuchasmodificationorrenaming;atthesametime,AmazonS3servicedoesnotprovideacomplexdatadirectorystructurebutonlyprovidesaverysimplehierarchicalrelationship;userscancreatetheirownDatabucket(bucket),andalldataisstoreddirectlyinthisbucket.Inaddition,cloudstoragehastosolvetheproblemofusersharing.ThedatainAmazonS3storageisdirectlyaccessedandidentifiedthroughauniqueURL.Therefore,aslongasotherusersareauthorized,theycanaccessthroughtheURLofthedata.

Storagevirtualizationisanimportanttechnicalfoundationofcloudstorage.Itisatechnologythatunifiesmultipleisolatedstoragesystemsintoanabstractresourcepoolbyabstractingandencapsulatingthephysicalcharacteristicsoftheunderlyingstoragesystem.Throughstoragevirtualizationtechnology,cloudstoragecanachievemanynewfeatures.Forexample,thelogicalisolationofuserdata,thestreamlinedconfigurationofstoragespace,etc.

Hierarchicalstructure

Thehierarchicalstructureofthestoragesystemcanbedividedintofivelevels:registerset,cache,mainmemory,virtualmemoryandexternalmemory.Amongthem,theregistergroupisalwaysinsidetheCPU,andtheprogrammercanaccessitthroughtheregistername.Thereisnobusoperation,andtheaccessspeedisthefastest;theremaining4levelsarealloutsidetheCPU.Cacheandmainmemoryconstitutetheinternalstoragesystem,andtheprogrammercanaddressthroughthebus.Theaccessspeedofthememoryunitisworsethanthatoftheregister;thevirtualmemoryistransparenttotheprogrammer;theexternalstoragesystemhasalargecapacityandneedstoexchangedatawiththeCPUthroughtheI/Ointerface,andtheaccessspeedistheslowest.

Välimuisti

Välimuistin (Cache) alkuperäinen merkitys viittaa RAM-tyyppiin, jolla on nopeampi pääsynopeus kuin tavallisessa satunnaiskäyttömuistissa (RAM). Yleisesti ottaen se ei käytä dynaamista satunnaisliityntämuistia (DARM), mutta käyttää järjestelmää, mutta pääjärjestelmänä. SRAM) tekniikkaa.

Thehigh-speedbuffermemoryisaprimarymemorybetweenthemainmemoryandtheCPU.Itiscomposedofastaticmemorychip(SRAM).Ithasasmallcapacitybutamuchfasterspeedthanthemainmemory.ItsmostimportantindicatorIsitshitrate.Theschedulingandtransferofinformationbetweenthecachememoryandthemainmemoryareautomaticallyperformedbythehardware.

Kompositiorakenne

Thecachememoryismainlycomposedofthefollowingthreeparts:

  1. Välimuistipankki:Tallenna ohjeet ja päämuistista siirretyt tiedot.Tallennusjärjestelmä

  2. Osoitteenmuunnoskomponentti: Luo hakemistotaulukko muuntaaksesipäämuistiosoitteen välimuistiosoitteeksi.

  3. Vaihda komponentti: Kun välimuisti on täynnä, suorita tiedonvaihto tietyn strategian mukaisesti ja muokkaa hakemistotaulukkoa headdress-käännöskomponentissa.

Toimintaperiaate

High-speedmemoryisusuallycomposedofhigh-speedmemory,Lenovomemory,replacementlogiccircuitandcorrespondingcontrolcircuitcomposition.Inacomputersystemwithacachememory,theaddressoftheprocessortoaccessthemainmemoryisdividedintothreefields:rownumber,columnnumber,andgroupaddress.Therefore,themainmemoryislogicallydividedintoseveralrows:eachrowisdividedintoseveralmemorycellgroups;eachgroupcontainsseveralordozensofwords.High-speedmemoryisalsodividedintorowsandcolumnsofmemorycellgroupsaccordingly.Bothhavethesamenumberofcolumnsandthesamegroupsize,butthenumberofrowsinthehigh-speedmemoryismuchsmallerthanthatinthemainmemory.

Lenovomemoryisusedforaddressassociationandhasstorageunitswiththesamenumberofrowsandcolumnsashigh-speedmemory.Whenamemorycellgroupinacertaincolumnandrowofthemainmemoryistransferredtoanemptymemorycellgroupinthesamecolumnofthehigh-speedmemory,thememorycellcorrespondingtotheLenovomemoryrecordstherownumberofthetransferredmemorycellgroupinthemainmemory.

Whentheprocessoraccessesthemainmemory,thehardwarefirstautomaticallydecodesthecolumnnumberfieldoftheaccessaddress,soastocombinealltherownumbersoftheLenovomemorywiththerownumberofthemainmemoryaddressFieldsarecompared.Iftheyarethesame,itindicatesthatthemainmemoryunittobeaccessedisalreadyinthehigh-speedmemory,whichiscalledahit.Thehardwaremapstheaddressofthemainmemorytotheaddressofthehigh-speedmemoryandexecutestheaccessoperation;iftheyarenotthesame,thenIndicatesthattheunitisnotinthehigh-speedmemory,whichiscalledfailure.Thehardwarewillperformtheoperationofaccessingthemainmemoryandautomaticallytransferthemainmemorycellgroupwheretheunitislocatedintotheemptymemorycellgroupinthesamecolumnofthehigh-speedmemory.TherownumberofthegroupinthemainmemoryisstoredintheunitatthecorrespondinglocationoftheLenovomemory.

Whenafailureoccursandthereisnoemptypositioninthecorrespondingcolumnofthehigh-speedmemory,acertaingroupinthecolumniseliminatedtomakeroomforthenewlytransferredgroup,whichiscalledreplacement.Therulesfordeterminingreplacementarecalledreplacementalgorithms.Commonlyusedreplacementalgorithmsincludeleastrecentlyusedalgorithm(LRU),first-infirst-outmethod(FIFO),andrandommethod(RAND).Thereplacementlogiccircuitperformsthisfunction.Inaddition,whenperformingawriteoperationtothemainmemory,inordertomaintaintheconsistencyofthecontentsofthemainmemoryandthehigh-speedmemory,thehitsandfailuresarehandledseparately.

Osoitekartoitus ja muuntaminen

Addressmappingreferstothecorrespondencebetweentheaddressofacertaindatainthemainmemoryandtheaddressinthecacherelation.Herearethreeaddressmappingmethods:

1.Täysin assosiatiivinen menetelmä

Theaddressmappingruleofthefully-associatedmethodis:anypieceofthemainmemorycanbemappedtotheCacheAnypiece.Thebasicrealizationideais:1)Themainmemoryandthecachearedividedintodatablocksofthesamesize;2)Acertaindatablockofthemainmemorycanbeloadedintoanyspaceofthecache.

ThedirectorytableisstoredinLenovomemoryandconsistsofthreeparts:theblockaddressofthedatablockinthemainmemory,theblockaddressafterstoringitinthecache,andtheeffectivebit(alsocalledtheloadbit).Sinceitisafullyassociativemethod,thecapacityofthedirectorytableshouldbethesameasthenumberofblocksinthecache.

Theadvantageofthefullassociativemethodisthatthehitrateisrelativelyhigh,andtheCachestoragespaceutilizationrateishigh;thedisadvantageisthatwhenaccessingtherelatedmemory,itmustbecomparedwiththeentirecontenteverytime,andthespeedislowandthecostishigh.Lessapplications.

2.Suoraassosiatiivinen menetelmä

TheaddressmappingruleofthedirectassociativemethodisthatablockinthemainmemorycanonlybemappedtoaspecificblockintheCache.Thebasicrealizationideais:

1)Päämuisti ja välimuisti on jaettu samankokoisiin tietotaulukkolohkoihin;

2)Themainmemorycapacityshouldbeanintegermultipleofthecachecapacity,andthemainmemoryspaceDivideintoareasaccordingtothecachecapacity,thenumberofblocksineachareaof​​themainmemoryisequaltothetotalnumberofblocksinthecache;

3)AblockofthemainmemorycanonlybestoredinthecachewhenitisstoredinthecachePositionwiththesameblocknumber.

Datablockswiththesameblocknumberineachareaof​​themainmemorycanbetransferredtotheaddresswiththesameblocknumberinthecache,butonlyoneblockcanbestoredinthecacheatthesametime.Sincethetwofieldsofthemainblocknumberandthecacheblocknumberandtheaddressintheblockarecompletelythesame,onlytheareacodeofthetransferredblockcanberecordedwhenthedirectoryisregistered.Thedirectorytableisstoredinhigh-speedandsmall-capacitymemory,andincludestwofields:theareanumberofthedatablockinthemainmemoryandtheeffectivebit.Thecapacityofthedirectorytableisthesameasthenumberofcachedblocks.

Theadvantageofthedirectassociativemethodisthattheaddressmappingmethodissimple.Whenaccessingdata,youonlyneedtocheckwhethertheareacodeisequal,soyoucangetfasteraccessspeedandsimplehardwareequipment;thedisadvantageisthereplacementoperationFrequent,thehitrateisrelativelylow.

3.Ryhmiä yhdistävä kartoitusmenetelmä

Theaddressmappingruleofthegroup-associativemappingmethodisthatablockinthemainmemorycanonlybestoredinanyblockofthesamegroupnumberinthecache.Thebasicrealizationideais:

1)Päämuisti ja välimuisti on jaettu lohkoihin saman koon mukaan;

2)Päämuisti ja välimuisti on jaettu ryhmiin saman koon mukaan:

3)Themainmemorycapacityisanintegermultipleofthecachecapacity.Themainmemoryspaceisdividedintoareasaccordingtothesizeofthecachearea.Thenumberofgroupsineachareaof​​themainmemoryisthesameasthenumberofgroupsinthecache;

4)Whenthedatainthemainmemoryistransferredtothecache,thegroupnumbersofthemainmemoryandthecacheshouldbeequal,thatis,ablockineachareacanonlybestoredinthespaceofthesamegroupnumberinthecache,buttheblocksinthegroupcanbearbitrarilyStorage,thatis,thedirectmappingmethodisadoptedfromthegroupinthemainmemorytothegroupinthecache:afullyassociativemappingmethodisadoptedinthetwocorrespondinggroups.

Theconversionbetweenthemainmemoryaddressandthecacheaddressconsistsoftwoparts:thegroupaddressadoptsthedirectmappingmethodandisaccessedbyaddress;whiletheblockaddressadoptsthefullyassociativemethodandisaccessedbycontent.

Theadvantageofthegroupassociativemappingmethodisthatthecollisionprobabilityoftheblockisrelativelylow,theutilizationrateoftheblockisgreatlyimproved,andthefailurerateoftheblockissignificantlyreduced:thedisadvantageisthatthedifficultyandcostofimplementationarehigherthanthatofthedirectmappingmethod..

Memory

Memory(Memory),alsoknownasinternalmemoryormainmemory,ismadeofsemiconductordevices.ItisoneoftheimportantpartsofacomputerandisdirectlyaddressablebytheCPU.Thestoragespaceischaracterizedbyfastaccessspeed.Allprogramsinthecomputerareruninthememory,sotheperformanceofthememoryhasagreatimpactonthecomputer.ThefunctionofthememoryistotemporarilystorethearithmeticdataintheCPUandthedataexchangedwithexternalstoragesuchasharddisks.Aslongasthecomputerisrunning,theCPUwilltransferthedatathatneedstobecalculatedintothememoryforcalculation,andwhenthecalculationiscompleted,theCPUwilltransmittheresult.

Theprogramsweusuallyuse,suchasWindowsoperatingsystem,typingsoftware,gamesoftware,etc.,aregenerallyinstalledonexternalstoragesuchasharddisks,buttheirfunctionscannotbeusedalone.TheymustbeinstalledOnlywhenitisloadedintothememorytorun,canwereallyuseitsfunctions.Weusuallyenteraparagraphoftextorplayagame,infact,itisalldoneinthememory.Justlikeinastudyroom,thebookshelvesandbookcasesstoringbooksareequivalenttotheexternalstorageofthecomputer,andthedeskwhereweworkisthememory.Usuallywestorealargeamountofdatatobestoredpermanentlyonexternalmemory,andputsometemporaryorasmallamountofdataandprogramsinthememory.Ofcourse,theperformanceofthememorywilldirectlyaffecttheoperatingspeedofthecomputer.

Muisti sisältää kaksi tyyppiä vain lukumuistia (ROM) ja satunnaiskäyttömuistia (RAM).

Vain lukumuisti (ROM)

Vain lukumuisti onROM(ReadOnlyMemory)).Kun ROM valmistetaan, tiedot (tieto tai ohjelma) tallennetaan ja tallennetaan pysyvästi.Tiedot voidaan vain lukea, ei kirjoiteta, ja tiedot eivät kelpaa, jos kone on sammutettu. allyadualin-line(DIP)integroitu lohko.

RandomAccessMemory (RAM)

RandomAccessMemoryisRAM(RandomAccessMemory),whichmeansthatdatacanbereadfromorwrittento.Whenthepowerofthemachineisturnedoff,thedatastoredinitwillbelost.Thememorymodule(SIMM)thatweusuallybuyorupgradeisusedasthecomputer'smemory.ItisasmallcircuitboardthatintegratestheRAMintegratedblockandplugsitintothememoryslotinthecomputertoreducetheRAMintegratedblockoccupancySpace.

Finallyintroducethetwoconceptsofphysicalmemoryandstorageaddressspace.Theyaretwodifferentconcepts,butbecausethereisaverycloserelationshipbetweenthetwo,andtheybothuseB,KB,MB,andGBtomeasuretheircapacity,itiseasytocauseconfusion.Physicalmemoryreferstoaspecificmemorychipthatactuallyexists.Forexample,thememorybarinstalledonthemotherboardandtheROMchiploadedwiththesystemBIOS,thedisplayRAMchiponthedisplaycardandtheROMchiploadedwiththedisplayBIOS,andtheRAMchipsandROMchipsonvariousadaptercardsareallphysicalmemories.Thestorageaddressspacereferstotherangeofmemoryencoding(encodingaddress).Theso-calledencodingistoassignanumbertoeachphysicalstorageunit(abyte),usuallycalled"addressing".Thepurposeofassigninganumbertoastorageunitistofinditeasilyandcompletethereadingandwritingofdata.Thisistheso-called"addressing",sosomepeoplealsocallthestorageaddressspaceaddressingspace.

Thesizeofthestorageaddressspaceandthesizeofthephysicalmemoryarenotnecessarilyequal.Letmegiveanexampletoillustratethisproblem:Thereare17roomsonafloor,andtheirnumbersare801~817.These17roomsarephysical,andtheiraddressspaceusesathree-digitcode,rangingfrom800to899,atotalof100addresses.Itcanbeseenthattheaddressspaceislargerthantheactualnumberofrooms.Formicrocomputersabove386,theaddressbusis32bits,sotheaddressspacecanreach2B,thatis,4GB.

Non-VolatileMemory (NVM)

Thenon-volatilememory(Non-Volatilememory,NVM)thathasappearedinrecentyearsischaracterizedbyitshighintegrationFeaturessuchashighspeed,lowenergyconsumption,non-volatility,andbyteaddressinghavereceivedwidespreadattention.Academiaandindustryhavedevelopedsomenewnon-volatilestoragemediaandtechnologies,suchasMagneticRAM(MRAM),SpinTransferTorqueRAM(STT-RAM),andPhaseChangeMemory(PhaseChangeMemory,PCM),resistiveRAM(RRAM),ferroelectricRAM(FerroelectricRAM,FeRAM),etc.Themainparametersofseveralmainstreamnewstoragedevicesarelistedinthetable.Itcanbeseenfromthetablethatnon-volatilestoragehasgoodperformanceintermsofintegrationandreadspeed,andisacandidateforconstructingpotentialnewstoragedevices.However,non-volatilestoragealsohasseveralobviousshortcomings:1)Ithasalargewritedelay,whichisanorderofmagnitudelargerthanthecorrespondingstoragemedium,andthewritedelayisgreaterthanthereaddelay,thatis,readandwriteareinconsistent.2)Althoughthereadoperationofnon-volatilestorageisfasterthanthewriteoperation,itisstillslowerthanthereadoperationoftraditionalstoragemedia;3)Thewritelifeofnon-volatilestorageislimited.Inthecaseofcontinuouswriting,thestorageunitisveryItwillsoonexpire.

Disk

Diskisthemostcommonlyusedexternalstorage.Itisaroundmagneticdiskpackedinasquaresealedbox.ThepurposeofthisistopreventthediskThesurfaceisscratched,causingdataloss.Thedatainformationstoredonthediskcanbestoredforalongtimeandcanbeusedrepeatedly.Disksaredividedintofloppydisksandharddisks.Atpresent,floppydiskshavebeenbasicallyeliminated.Computerswidelyuseharddisks.Wecancompareittoalargewarehouseforcomputerstostoredataandinformation.

Kiintolevytyypit ja -kokoonpano

ThetypesofharddisksmainlyincludeSCSI,IDE,andthepopularSATA.Therearecertainstandardsfortheproductionofanykindofharddisk.Withtheupgradeofthecorrespondingstandard,theharddiskproductiontechnologyisalsoupgrading.Forexample,theSCSIstandardhasgonethroughSCSI-1,SCSI-2andSCSI-3.Atpresent,weoftenvisitthewebsiteTheUltral-160seenbytheserverisbasedontheSCSI-3standard.IDEfollowstheATAstandard,andthecurrentpopularSATAisanupgradedversionoftheATAstandard.IDEisaparallelportdevice,whileSATAisaserialport.SATAwasdevelopedtoreplaceIDE.

Yleensä riippumatta siitä, minkä tyyppiset kiintolevyt, se koostuu levystä, päästä, karasta, ohjausmoottorista, pääohjaimesta, tiedonmuuntimesta, käyttöliittymästä, välimuistista jne.

TheharddiskstructureisshowninFigure2-6.Alldiscsarefixedonarotatingshaft,whichisthediscspindle.Allthediscsareabsolutelyparallel.Thereisamagneticheadonthestoragesurfaceofeachdisc,andthedistancebetweenthemagneticheadandthediscissmallerthanthediameterofthehair.Alltheheadsareconnectedtoaheadcontroller,andtheheadcontrollerisresponsibleforthemovementofeachhead.Themagneticheadcanmoveradiallyalongtheradiusofthedisc(actuallyitisanobliquetangentialmovement).Eachmagneticheadmustalsobecoaxialatthesametime,thatis,whenviewedfromdirectlyabove,allmagneticheadsoverlapatalltimes(However,thereisalreadyamulti-headindependenttechnology,whichisnotsubjecttothislimitation).Thediscrotatesatahighspeedataspeedofthousandsofrevolutionsperminutetotensofthousandsofrevolutionsperminute,sothatthemagneticheadcanreadandwritedataataspecifiedlocationonthedisc.

Kiintolevyjen toimintaperiaate

1.Pinta

Thedisksofharddisksgenerallyusealuminumalloymaterialsasthesubstrate,high-speedharddisksItisalsopossibletouseglassasthesubstrate.Eachdiskofaharddiskhastwosides,namelytheupperandlowersides.Generally,eachsidewillbeusedtostoredataandbecomeaneffectivedisksurface.Therearealsoveryfewharddiskswithoddnumberofsides.Eachsucheffectivediskhasadisknumber,whichisnumberedsequentiallyfromtoptobottom,startingfrom0.Intheharddisksystem,thedisksurfacenumberisalsocalledtheheadnumber,becauseeachvaliddisksurfacehasacorrespondingreadandwritehead.Thedisksetofharddiskshas2to14platters,usually2to3platters,sothediskfacenumber(headnumber)is0~3or0~5.

2. Seuraa

Thediskisdividedintomanyconcentriccirclesduringlow-levelformatting.Theseconcentriccircletracksarecalledtracks,andinformationisrecordedonthesetracksintheformofpulsetrains.middle.Thetracksarenumberedsequentiallyfromtheoutsidetotheinside,startingfrom0.Eachharddiskhas300~1024tracksoneachsurface,andthenewlarge-capacityharddiskhasmoretracksoneachsurface.Eachtrackdoesnotrecorddatacontinuously,butisdividedintosegmentsofarcs.Theangularvelocitiesofthesearcsarethesame,butbecausetheradiallengthisdifferent,thelinearvelocityisalsodifferent.Thelinearvelocityoftheouterringishigherthanthatoftheinnerring.Thelinearvelocityislarge,thatis,underthesamerotationspeed,thelengthofthearcdrawnbytheouterringinthesameperiodoftimeisgreaterthanthelengthofthearcdrawnbytheinnerring.Eacharciscalledasector,andsectorsarenumberedstartingfrom1,andthedataineachsectorisreadorwrittenasaunitatthesametime.Thetracksareinvisible,justsomemagnetizedareasonthedisksurfacethataremagnetizedinaspecialway,andtheplanninghasbeencompletedwhenthediskisformatted.

3.Sylinteri

Thesametrackonalldisksformsacylinder,usuallycalledacylinder.Themagneticheadoneachcylindergoesfromtoptobottomandfrom0Startnumbering.Datareading/writingisperformedonacylinder,thatis,whentheheadreads/writesdata,theoperationstartsfromhead0inthesamecylinder,andthenoperatesondifferentdisksurfacesofthesamecylinder,thatis,thehead,onlyinthesamecylinder.Afterallthemagneticheadsonthesurfacehavebeenread/written,themagneticheadtransferstothenextcylinder(thecylinderthatisconcentricandtheninward),becausetheselectionofthemagneticheadonlyneedstobeswitchedelectronically,andtheselectionofthecylindermustbemechanicallySwitching,thespeedoftheheadmovingtotheadjacenttrackduringelectronicswitchingismuchfasterthanthatduringmechanicalswitching.Therefore,datareading/writingisperformedonthecylinderinsteadofthedisksurface,therebyimprovingtheread/writeefficiencyoftheharddisk.

Thenumberofcylindersofaharddiskdrive(orthenumberoftracksperdisk)dependsonthewidthofeachtrack(alsorelatedtothesizeofthehead),andalsodependsonthepositioningmechanismThesizeofthestepbetweentracks.

4.Sektori

Theoperatingsystemstoresinformationontheharddiskintheformofsectors(Sector).Eachsectorincludestwomainparts:sectoridentifierandstorageThedatasegmentofthedata(usually512B).

Sektorin tunniste, jota kutsutaan myös sektoriotsikoiksi, sisältää kolme numeroa, jotka muodostavat tämän sektorin kolmiulotteisen osoitteen:1)Levyn numero:pää(ordisk),jossa sektori sijaitsee2)Sylinterinumero:Raita,määritä pään säteittäinen suunta:3)Sektorinumeron sijainti, tiedot levyympyrässä.

Thesectorheaderalsoincludesafield,inwhichthereisamarkthatidentifieswhetherthesectorcanreliablystoredata.Someharddiskcontrollersalsorecordpointersinthesectorheader,whichcandirectthedisktoareplacementsectorortrackwhentheoriginalsectoriswrong.Finally,thesectorheaderendswithacyclicredundancycheck(CRC)value,sothatthecontrollercancheckthereadoutofthesectorheadertoensureaccuracy.

Thedatasegmentofasectorisusedtostoredatainformation,includingdataanderrorcorrectioncodes(ECC)fordataprotection.Duringtheinitialpreparation,thecomputerfills512virtualinformationbytes(thestoragelocationoftheactualdata)andtheECCnumberscorrespondingtothesevirtualinformationbytesintothispart.

Käyttöperiaate

Pino

Pino on tilaa soittopolun ja parametrien tallentamiseen, kunClanguage-ohjelma on käynnissä: mukaan lukien toimintokutsukehys, välitysparametrit,paluuosoitteen tallentaminen ja paikallismuuttujatilan tallentaminen.

Perustieto pinosta

1. Pinoa koskevat rekisterit

1)esp:pinon yläosan osoitin;

2)ebp:baseaddressosoitin(ebpi käytetään tallentamaan nykyinen toimintopuhelun perusosoiteClanguage);

3)cs:eippointstotheaddressofhenextinstruction,onkaksi tapausta;

(1)Peräkkäinen suoritus: osoittaa aina poistumisohjeeseen peräkkäisillä osoitteilla;

(2)Jump/Branch:Kun komento suoritetaan, arvoa cs:eip muutetaan ohjelman tarpeiden mukaan;

4)call:pushthecurrentvalueofcs:eiponttopinon alkuun,cs:eippoint kutsutun toiminnon syöttöosoitteeseen;

5)ret:Popthevalueofcs:eiporiginallytallennetuttähänpinonyläosastajaputittocs:eip;

6)iret:Popthecs:eipandflagtallennettu alunperintähänpinonpäältäValue,putitincs:eipandflagregister.

2. Pinoaminen

1)push:pinon yläosassa oleva osoitin pienenee 4 tavua (32 bittiä):

2)pop:pinon yläosassa oleva osoitin kasvoi 4 tavua (32 bittiä).

Pinon käyttö toimintopuhelun aikana

TheoperationofthestackduringthefunctioncallisshowninFigure3.AmainfunctioncallsaForsub-functions,thespecificstepsofthecallingprocessaredescribedasfollows:

  1. Ennen kutsun suorittamista,esppointpinon yläosaanjabppointpinon alareunaan;

  2. Kun puhelu suoritetaan, cs:eip-alkuperäinen arvo siirretäänpinon alkuun,ja sitten arvocs:eippoint kutsutun ohjelman syöttöosoitteeseen;

  3. Syötä kutsuttu ohjelma,ensimmäinen komento:pushl%ebp,secondition:movl%esp,%ebp;

  4. Anna kutsuttu ohjelma ja sitten pino voidaan työntää pinoon jne. Normaali toiminta;

  5. Poistu kutsutusta ohjelmasta,ensimmäinen ohjeistusovl%ebp,%esp,thecondinstructionispopl%ebp,jakolmaskäsky onret.Tällä hetkellä poistu kutsutusta ohjelmastajapalautaheaddresstoeipthroughret.

Paikallisuuden periaate

Paikallisuuden periaate viittaa siihen, mitäkäytetään, kun CPU käyttää muistia, onkotallennusyksiköt ryhmitelty pieneksi jatkuvaksi alueeksi.

Paikkakunnalla on yleensä kaksi muotoa:

Temporallocality:Jos tietokohdetta käytetään,ontodennäköisesti päästään uudelleen lähitulevaisuudessa. Ohjelmasilmukat, pinot jne.syy ovat tilapäisen paikallisuuden syynä.

Spatiallocality:Theinformationthatwillbeusedinthenearfutureislikelytobeclosetotheinformationcurrentlyinuseinthespatialaddress.

Alllevelsofmoderncomputersystems,fromhardwaretooperatingsystems,toapplications,aredesignedusingtheprincipleoflocality.Atthehardwarelevel,theprincipleoflocalityallowscomputerdesignerstosaverecentlyreferencedinstructionsanddataitemsbyintroducingasmallandfastcachememory,therebyincreasingthespeedofaccesstothemainmemory.Attheoperatingsystemlevel,thelocalityprincipleallowsthesystemtousemainmemoryasthemostrecentlyreferencedcacheinthevirtualaddressspace.Thelocalityprinciplealsoallowsthesystemtousethemainmemorytocachethemostrecentlyuseddiskblocksinthediskfilesystem.Theprincipleoflocalityalsoplaysanimportantroleinthedesignofanapplication.Forexample,aWebbrowserplacesarecentlyciteddocumentonalocaldisk,usingtemporallocality.AlargenumberofWebserversstorerecentlyrequesteddocumentsinfront-enddiskcaches.Thesecachescansatisfyuserrequestsforthesedocumentswithoutanyinterventionfromtheserver.

Thefollowingthreeexamplesareusedtoillustratethelocalityoftheprogram'sdatareference.

Esimerkki1:

intsumvec(intv[N])

{

inti=0,summa=0;

for(inti=0;i

{

summa+=v[i];

}

palautus;

}

Intheabovecode,thevariablesumisreferencedonceineachloopiteration,whichhastimelocality.Fortheelementsofthearrayv,theyarestoredaccordingtothemTheorderinthememoryisreadsequentially,soithasspatiallocality,buteacharrayelementisonlyaccessedonce,soithasnotemporallocality.ItcanbeseenthatthesumvecfunctionhasbothspatiallocalityandtimefordataaccessLocality.

Esimerkki2:

intsumarrayros(intv[M][N])

{

inti=0;j=0;summa=0;

for(i=0;i

for(j=0;j

{

summa+=v[i][j];

}

palautus;

}

Intheabovecode,Theelementsofarrayvareaccessedaccordingtothestepsize1,soithasgoodspatiallocality(arrayelementsarestoredinroworder).

Esimerkki3:

intsumarrayros(intv[M][N])

{

inti=0;j=0;summa=0;

for(j=0;j

for(i=0;i

{

summa+=v[i][j];

}

palautus;

}

Intheabovecode,theelementsofthearrayvareaccessedaccordingtothestepsizeN,soitsspatiallocalityVerybad.Insummary,thefollowingconclusionscanbedrawn:

1)Ohjelmat, jotka toistuvasti viittaavat samaan muuttujaan, joilla on hyvä aikapaikka;

2)ForthosewithasteplengthofkTheprograminthereferencemode,thesmallerthestepsize,thebetterthespatiallocality.Theprogramthatjumpsaroundinthememorywithlargesteps,thespatiallocalitywillbepoor;

3)Ohjeiden noutoToisin sanoen,silmukanhyvä aika- ja alueellinen sijainti.Pienempisilmukkarunko,enemmän silmukointia,parempi paikka.

This article is from the network, does not represent the position of this station. Please indicate the origin of reprint
TOP