CN104598161A - Data reading and writing method and device and data storage structure - Google Patents

Data reading and writing method and device and data storage structure Download PDF

Info

Publication number
CN104598161A
CN104598161A CN201310534962.0A CN201310534962A CN104598161A CN 104598161 A CN104598161 A CN 104598161A CN 201310534962 A CN201310534962 A CN 201310534962A CN 104598161 A CN104598161 A CN 104598161A
Authority
CN
China
Prior art keywords
data block
data
hard disk
index
page
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.)
Granted
Application number
CN201310534962.0A
Other languages
Chinese (zh)
Other versions
CN104598161B (en
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201310534962.0A priority Critical patent/CN104598161B/en
Publication of CN104598161A publication Critical patent/CN104598161A/en
Application granted granted Critical
Publication of CN104598161B publication Critical patent/CN104598161B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a data reading and writing method and device and a data storage structure. The method comprises the steps that the additional numbers of data blocks are obtained; index content in data indexes is obtained according to the additional numbers and the data indexes; the hard disk number of the data blocks and partial page numbers of the data blocks are obtained according to global page numbers of the data blocks and the number of hard disks; an asynchronous reading request of the data blocks is submitted according to the page numbers, the hard disk numbers and the partial page numbers of the data blocks; according to the asynchronous reading request, after an operating system reads the data blocks, the data blocks are called back to corresponding processing flows; paging processing is carried out by the hard disks according to physical pages of the hard disks, so that hard disk storage pages comprising the physical pages of at least one hard disk is formed; each storage page corresponds to one data block. According to the data reading and writing method and device and the data storage structure, the positions of the corresponding data blocks can be obtained through the data indexes, and each storage page only corresponds to one data block, so that reading and writing operation of the data blocks is quickened.

Description

Digital independent, wiring method and device and data store organisation
Technical field
The present invention relates to data processing field, particularly relate to a kind of digital independent, wiring method and device and data store organisation.
Background technology
SSD (Solid State Disk, solid state hard disc) be a kind of memory device based on flash memory, the hard disk made with solid-state electronic storage chip array, by control module and storage unit (FLASH chip or DRAM(Dynamic Random Access Memory, dynamic RAM) chip) composition.SSD to be inserted in I/O bus in standard hard drive slot, processes from CPU(Central Processing Unit, central processing unit) the request of read-write logic magnetic disc block.A SSD comprises one or more flash chip and flash memory translation layer, flash chip substitutes the thermo-mechanical drive in traditional magnetic disk, flash memory translation layer is then a hardware/firmware equipment, identical with the effect of Magnetic Disk Controller, the request of logical block will be translated into the access to bottom layers of physical devices.
As shown in table 1, the performance of the order read operation (CPU is access logic disk block in order) of current SSD dish and sequential write operation is suitable.But, when CPU is according to random-sequential access logic magnetic disc block, a write operation order of magnitude slower in read operation.
Table 1
The performance difference of random write operation and random writing operations is determined by bottom flash memory base attribute.As a flash memory is made up of the sequence of m block, each piece is made up of n page.Data carry out read-write operation in units of page, only after the block belonging to one page is by whole erasing, could carry out write operation at this page.
When carrying out random writing operations, erase block needs the time (ms level) relatively grown, an order of magnitude higher than the time needed for read operation.If write operation attempts the page that amendment one has comprised data simultaneously, so in this page, all blocks with data all must be copied to another page, then could carry out write operation to this page.
Because the random write operation of current SSD dish and the running time of random writing operations differ greatly, cause easily blocking treatment scheme when digital independent and write, the application process in flow process effectively cannot utilize computational resource and the storage resources of equipment.
Summary of the invention
The object of the embodiment of the present invention is to provide a kind of method for reading data, easily blocks application process to solve existing method for reading data, causes application process effectively cannot utilize the computational resource of equipment and the technical matters of storage resources.
The object of the embodiment of the present invention is also to provide a kind of method for writing data, easily blocks application process to solve existing method for writing data, causes application process effectively cannot utilize the computational resource of equipment and the technical matters of storage resources.
The object of the embodiment of the present invention is also to provide a kind of data store organisation, to solve existing digital independent and wiring method easily blocks application process, causes application process effectively cannot utilize the computational resource of equipment and the technical matters of storage resources.
The object of the embodiment of the present invention is also to provide a kind of data fetch device, easily blocks application process to solve existing data fetch device, causes application process effectively cannot utilize the computational resource of equipment and the technical matters of storage resources.
The object of the embodiment of the present invention is also to provide a kind of data transfer apparatus, easily blocks application process to solve existing data transfer apparatus, causes application process effectively cannot utilize the computational resource of equipment and the technical matters of storage resources.
For solving the problem, technical scheme provided by the invention is as follows:
There is provided a kind of method for reading data, it comprises step:
Obtain the address number of data block;
According to described address number and data directory, obtain the index content in described data directory, wherein said index content comprises data block number of pages and data block overall situation page number;
According to described data block overall situation page number and hard disk quantity, obtain hard disk reel number and the data block local page number of described data block;
According to described data block number of pages, described hard disk reel number and described data block local page number, submit the asynchronous read requests of data block to; And
After operating system read block, according to described asynchronous read requests, adjust back in corresponding treatment scheme;
Wherein said hard disk carries out paging process with the physical page of described hard disk, to form the memory page of the described hard disk of the physical page comprising hard disk described at least one; Data block described in memory page correspondence one described in each; Generate described data block overall situation page number according to the memory page of described data block, generate described data block number of pages according to the size of described data block.
Also provide a kind of method for writing data, it comprises step:
According to data directory, obtain the data block overall situation page number of the memory page of the blank of described hard disk;
According to the data block overall situation page number of the memory page of described data block and described blank, generate the index content corresponding with described data block and address number, wherein said index content comprises data block number of pages and the overall page number of data block;
According to described data block overall situation page number and hard disk quantity, generate hard disk reel number and the data block local page number of described data block;
According to described data block number of pages, described hard disk reel number and described data block local page number, submit data block write request to; And
According to the result of said write request, described index content is used to upgrade described data directory;
Wherein said hard disk carries out paging process with the physical page of described hard disk, to form the memory page of the described hard disk of the physical page comprising hard disk described at least one; Data block described in memory page correspondence one described in each; Generate described data block overall situation page number according to the memory page of described data block, generate described data block number of pages according to the size of described data block.
Also provide a kind of data store organisation, it comprises:
Data store, comprises multiple hard disk, and described hard disk carries out paging process with the physical page of described hard disk, to form the memory page of the described hard disk of the physical page comprising hard disk described at least one; The wherein corresponding data block of memory page described in each;
Data directory portion, comprises index content, comprising:
Data block number of pages, for representing the size of described data block; And
Data block overall situation page number, for representing the memory location of described data block; And
Address number, corresponding with described index content, for being supplied to user, with read block.
Also provide a kind of data fetch device, it comprises:
Address acquisition module, for obtaining the address number of data block;
Index acquisition module, for according to described address number and data directory, obtains the index content in described data directory, and wherein said index content comprises data block number of pages and data block overall situation page number;
Position acquisition module, for according to described data block overall situation page number and hard disk quantity, obtains hard disk reel number and the data block local page number of described data block;
Module is submitted in request to, for according to described data block number of pages, described hard disk reel number and described data block local page number, submits the asynchronous read requests of data block to; And
Callback module, after operating system read block, for according to described asynchronous read requests, adjusts back in corresponding treatment scheme;
Wherein said hard disk carries out paging process with the physical page of described hard disk, to form the memory page of the described hard disk of the physical page comprising hard disk described at least one; Data block described in memory page correspondence one described in each; Generate described data block overall situation page number according to the memory page of described data block, generate described data block number of pages according to the size of described data block.
Also provide a kind of data transfer apparatus, it comprises:
Position acquisition module, for according to data directory, obtains the data block overall situation page number of the memory page of the blank of described hard disk;
Index generation module, for the data block overall situation page number of the memory page according to described data block and described blank, generates the index content corresponding with described data block and address number, and wherein said index content comprises data block number of pages and data block overall situation page number;
Position generation module, for according to described data block overall situation page number and hard disk quantity, generates hard disk reel number and the data block local page number of described data block;
Writing module, for according to described data block number of pages, described hard disk reel number and described data block local page number, submits data block write request to; And
Update module, for the result according to said write request, uses described index content to upgrade described data directory;
Wherein said hard disk carries out paging process with the physical page of described hard disk, to form the memory page of the described hard disk of the physical page comprising hard disk described at least one; Data block described in memory page correspondence one described in each; Generate described data block overall situation page number according to the memory page of described data block, generate described data block number of pages according to the size of described data block.
Compared to prior art, digital independent of the present invention, wiring method and device and data store organisation obtain the position of corresponding data block by data directory, and each memory page only a corresponding data block can accelerate reading and the write operation of data block, solve existing digital independent, wiring method and device and easily block application process, cause application process effectively cannot utilize the computational resource of equipment and the technical matters of storage resources.
Accompanying drawing explanation
Fig. 1 is the working environment structural representation of the electronic equipment at data fetch device of the present invention and data transfer apparatus place;
Fig. 2 is the structural representation of the preferred embodiment of data store organisation of the present invention;
Fig. 3 is the structural representation of the preferred embodiment of data fetch device of the present invention;
Fig. 4 is the process flow diagram of the preferred embodiment of method for reading data of the present invention;
Fig. 5 is the structural representation of the preferred embodiment of data transfer apparatus of the present invention;
Fig. 6 is the process flow diagram of the preferred embodiment of method for writing data of the present invention;
Fig. 7 is the process flow diagram of the specific embodiment of method for writing data of the present invention and device;
Fig. 8 is the process flow diagram of the specific embodiment of method for reading data of the present invention and device.
Embodiment
Please refer to graphic, wherein identical element numbers represents identical assembly, and principle of the present invention implements to illustrate in a suitable computing environment.The following description is based on the illustrated specific embodiment of the invention, and it should not be regarded as limiting the present invention not at other specific embodiment that this describes in detail.
In the following description, specific embodiments of the invention illustrate, unless otherwise stating clearly with reference to the step of the operation performed by or multi-section computing machine and symbol.Therefore, it can recognize these steps and operation, wherein have and will mention as being performed by computing machine for several times, include and handled with the computer processing unit of the electronic signal of the data in a structuring pattern by representing.These data of this manipulation transforms or the position maintained in the memory system of this computing machine, its reconfigurable or other running changing this computing machine in a manner familiar to those skilled in the art.The data structure that these data maintain is the provider location of this internal memory, and it has the particular characteristics defined by this data layout.But the principle of the invention illustrates with above-mentioned word, it is not represented as a kind of restriction, and those skilled in the art can recognize that the plurality of step of the following stated and operation also may be implemented in the middle of hardware.
" assembly ", " module ", " system ", " interface ", " process " etc. are usually intended to refer to computer related entity as used herein the term: the combination of hardware, hardware and software, software or executory software.Such as, assembly can be but be not limited to be run process on a processor, processor, object, can perform application, the thread performed, program and/or computing machine.By diagram, run application on the controller and this both controller can be assembly.One or more assembly can have in the process and/or thread that are to perform, and assembly and/or can be distributed between two or more computing machines on a computing machine.
And claimed theme may be implemented as and uses standard program and/or engineering to produce software, firmware, hardware or its combination in any with the method for the theme disclosed in computer for controlling realization, device or manufacture.Term as used herein " manufacture " is intended to comprise can from the computer program of any computer readable device, carrier or medium access.Certainly, those skilled in the art will recognize that and can carry out many amendments to this configuration, and do not depart from scope or the spirit of claimed theme.
Fig. 1 and discussion subsequently provide brief, the description of summarizing to the working environment of the electronic equipment realizing data fetch device of the present invention and data transfer apparatus place.The working environment of Fig. 1 is only an example of suitable working environment and is not intended to any restriction of suggestion about the purposes of working environment or the scope of function.Example electronic equipment 112 includes but not limited to personal computer, server computer, hand-held or laptop devices, mobile device (such as mobile phone, personal digital assistant (PDA), media player etc.), multicomputer system, consumer electronic devices, small-size computer, mainframe computer, comprises the distributed computing environment of above-mentioned any system or equipment, etc.
Although do not require, under the common background that " computer-readable instruction " is performed by one or more electronic equipment, embodiment is described.Computer-readable instruction can distribute via computer-readable medium (hereafter discussing).Computer-readable instruction can be implemented as program module, such as performs particular task or realizes the function, object, application programming interface (API), data structure etc. of particular abstract data type.Typically, the function of this computer-readable instruction can arbitrarily combine or distribute in various environment.
Fig. 1 illustrates the example of the electronic equipment 112 of the one or more embodiments comprising method for reading data of the present invention and method for writing data.In one configuration, electronic equipment 112 comprises at least one processing unit 116 and storer 118.According to exact configuration and the type of electronic equipment, storer 118 can be volatibility (such as RAM), non-volatile (such as ROM, flash memory etc.) or certain combination of the two.This configuration is illustrated by dotted line 114 in FIG.
In other embodiments, electronic equipment 112 can comprise supplementary features and/or function.Such as, equipment 112 can also comprise additional memory storage (such as removable and/or non-removable), and it includes but not limited to magnetic memory apparatus, light storage device etc.This additional memory devices is illustrated by memory storage 120 in FIG.In one embodiment, the computer-readable instruction for realizing one or more embodiment provided in this article can in memory storage 120.Memory storage 120 can also store other computer-readable instructions for realizing operating system, application program etc.Computer-readable instruction can be loaded in storer 118 and be performed by such as processing unit 116.
Term as used herein " computer-readable medium " comprises computer-readable storage medium.Computer-readable storage medium comprises the volatibility and non-volatile, removable and non-removable medium that realize for any method of the information storing such as computer-readable instruction or other data and so on or technology.Storer 118 and memory storage 120 are examples of computer-readable storage medium.Computer-readable storage medium includes but not limited to RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital universal disc (DVD) or other light storage devices, magnetic tape cassette, tape, disk storage device or other magnetic storage apparatus or may be used for storing expectation information and any other medium can accessed by electronic equipment 112.Computer-readable storage medium so arbitrarily can be a part for electronic equipment 112.
Electronic equipment 112 can also comprise the communication connection 126 allowing electronic equipment 112 and other devices communicatings.Communication connection 126 can include but not limited to modulator-demodular unit, network interface unit (NIC), integrated network interface, radiofrequency launcher/receiver, infrared port, USB connection or other interfaces for electronic equipment 112 being connected to other electronic equipments.Communication connection 126 can comprise wired connection or wireless connections.Communication connection 126 can be launched and/or received communication media.
Term " computer-readable medium " can comprise communication media.Communication media typically comprises other data in " the own modulated data signal " of computer-readable instruction or such as carrier wave or other transport sectors and so on, and comprises any information delivery media.Term " own modulated data signal " can comprise such signal: one or more according to being arranged to the mode in signal by information coding or changing in this characteristics of signals.
Electronic equipment 112 can comprise input equipment 124, such as keyboard, mouse, pen, voice-input device, touch input device, infrared camera, video input apparatus and/or any other input equipment.Also output device 122 can be comprised, such as one or more display, loudspeaker, printer and/or other output devices arbitrarily in equipment 112.Input equipment 124 and output device 122 can be connected to electronic equipment 112 via wired connection, wireless connections or its combination in any.In one embodiment, input equipment 124 or the output device 122 of electronic equipment 112 can be used as from the input equipment of another electronic equipment or output device.
The assembly of electronic equipment 112 can be connected by various interconnection (such as bus).Such interconnection can comprise periphery component interconnection (PCI) (such as quick PCI), USB (universal serial bus) (USB), live wire (IEEE1394), optical bus structure etc.In another embodiment, the assembly of electronic equipment 112 can pass through network interconnection.Such as, storer 118 can by be arranged in different physical location, formed by multiple physical memory cells arc of network interconnection.
Those skilled in the art will recognize that, can spanning network distribution for the memory device storing computer-readable instruction.Such as, the electronic equipment 130 can accessed via network 128 can store the computer-readable instruction for realizing one or more embodiment provided by the present invention.Electronic equipment 112 can access electronic equipment 130 and a part for downloading computer instructions or all for execution.Alternately, electronic equipment 112 can download many computer-readable instructions on demand, or some instructions can electronic equipment 112 place perform and some instructions can perform at electronic equipment 130 place.
There is provided herein the various operations of embodiment.In one embodiment, described one or more operations can form the computer-readable instruction that one or more computer-readable medium stores, and it will make computing equipment perform described operation when being performed by electronic equipment.The order describing some or all of operation should not be interpreted as implying what these operations were necessarily sequentially correlated with.It will be appreciated by those skilled in the art that the alternative sequence of the benefit with this instructions.And, should be appreciated that not all operation must exist in each embodiment provided in this article.
And word used herein " preferably " means to be used as example, example or illustration.Any aspect that Feng Wen is described as " preferably " or design need not be interpreted as than other aspects or design more favourable.On the contrary, the use of word " preferably " is intended to propose concept in a concrete fashion.Term "or" as used in this application is intended to the "or" that means to comprise and the "or" of non-excluded.That is, unless otherwise or clear from the context, " X uses A or B " means any one that nature comprises arrangement.That is, if X uses A; X uses B; Or X uses both A and B, then " X uses A or B " is met in aforementioned arbitrary example.
And although illustrate and describe the disclosure relative to one or more implementation, those skilled in the art are based on to the reading of this instructions and accompanying drawing with understand and will expect equivalent variations and amendment.The disclosure comprises all such amendments and modification, and is only limited by the scope of claims.Especially about the various functions performed by said modules (such as element, resource etc.), term for describing such assembly is intended to the random component (unless otherwise instructed) corresponding to the appointed function (such as it is functionally of equal value) performing described assembly, even if be not structurally equal to the open structure of the function performed in exemplary implementations of the present disclosure shown in this article.In addition, although special characteristic of the present disclosure relative in some implementations only one be disclosed, this feature can with can be such as expect and other Feature Combinations one or more of other favourable implementations for given or application-specific.And, " comprise " with regard to term, " having ", " containing " or its distortion be used in embodiment or claim with regard to, such term is intended to comprise " to comprise " similar mode to term.
Please refer to Fig. 2, Fig. 2 is the structural representation of the preferred embodiment of data store organisation of the present invention.The data store organisation 20 of this preferred embodiment comprises data store 21, data directory portion 22 and address number 23.Wherein data store 21 comprises multiple hard disk 211, and this hard disk 211 carries out paging process with the physical page of hard disk 211, to form the memory page 2111 of the hard disk 211 of the physical page comprising at least one hard disk 211; The corresponding data block of each memory page 2111.Namely each hard disk 211 comprises multiple memory page 2111, and each memory page 2111 comprises at least one physical page, and such Same Physical page only can store same data block.Therefore only have when data block is deleted and just can carry out erasing process to this physical page, do not need the write operation in order to carry out other data blocks and the data block in this physical page copied and wipes process.
Data directory portion 22 comprises index content 221 and index stem 222.Wherein index content 221 comprise data block number of pages 2211, data block the overall situation page number 2212 and data there is mark 2213.Data block number of pages 2211 is for representing the size of data block; Data block overall situation page number 2212 is for representing the memory location (this data block overall situation page number 2212 has uniqueness in all data block overall situation page numbers of the hard disk of this electronic equipment) of data block; There is mark 2213 and there is the hard disc data corresponding with index content 221 for judging whether in data.By this index content 221, the validity of data block, size information and positional information can be obtained fast.The index content 221 simultaneously arranged like this does not have unnecessary information, can save corresponding storage space.
Index stem 222 comprises the use information of hard disk, the use information of index and shared label information.The use information of hard disk comprises hard disk quantity, hard disk number of pages, hard disk page size and current additional page number; The use information of index comprises the index quantity and untapped index quantity that have used; Shared label information comprises magic number and usage flag.Wherein hard disk quantity represents the hard disk quantity of electronic equipment, hard disk number of pages represents the quantity of the physical page of the hard disk 21 of electronic equipment, hard disk page size represents the size of the physical page of the hard disk 21 of electronic equipment, and current additional page number represents the page number of the untapped physical page of the hard disk 21 of electronic equipment.Evil spirit number is for representing the validity (as the data in data directory portion are tampered, then this magic number can change) of the data in this data directory portion, and usage flag is for representing data directory using state (using state or unused state).The service condition of hard disk 21 and index can be obtained accurately by this index stem user, and data validity in data directory portion 22 and using state.
Address number 23 for being supplied to user, to read corresponding data block.This address number 23 is corresponding with the index content 221 of respective data blocks.Such user obtains corresponding index content 221 by address number 23, and then obtains corresponding data block by index content 221.Preferably, in order to ensure the acquisition efficiency of index content, the address number 23 of data block and corresponding index content 221 store with key-value (key-value) form.
Preferably, the stem of data block that the data store organisation 20 of this preferred embodiment stores also comprises the School Affairs of data, data block overall situation page number and data actual length.Wherein the School Affairs of data is used for the validity (whether being tampered) of checking data block, and data block overall situation page number, for representing the data block overall situation page number of this data block, can compare with the data block overall situation page number in index content, to guarantee the validity of data.Data actual length is used for obtaining data block accurately, during owing to carrying out digital independent, be all the elements at least one memory page of disposable reading, and data block often can not use whole memory page, is therefore Existential Space fragment in part memory page.According to the data actual length of Data Block Header, the space junk in memory page can be removed from data block, thus the content of data block can be obtained accurately.
Use the data store organisation 20 of this preferred embodiment to carry out describing in detail in the process method for reading data below of digital independent and data write and the preferred embodiment of method for writing data, here do not set forth.
Each memory page only corresponding data block of the data store organisation of this preferred embodiment, therefore only has when deleting data block and just can carry out erasing process to this physical page, improve reading and the write operation efficiency of data block; The data store organisation of this preferred embodiment obtains the position of corresponding data block by data directory simultaneously, improves reading and the write operation efficiency of data block further.
Please refer to Fig. 3, Fig. 3 is the structural representation of the preferred embodiment of data fetch device of the present invention.The data fetch device 30 of this preferred embodiment can be arranged in above-mentioned electronic equipment 112, and it comprises address acquisition module 31, index acquisition module 32, position acquisition module 33, request submission module 34 and callback module 35.Address acquisition module 31 is for obtaining the address number of data block; Index acquisition module 32, for according to address number and data directory 36, obtains the index content in data directory 36, and wherein index content comprises data block number of pages, data overall situation page number and data existence mark; Position acquisition module 33, for according to data overall situation page number and hard disk quantity 37, obtains hard disk reel number and the data block local page number of data block; Request submits to module 34 for according to data block number of pages, hard disk reel number and data block local page number, submits the asynchronous read requests of data block to; Callback module 35, for after operating system read block, according to asynchronous read requests, is adjusted back in corresponding treatment scheme.
Wherein hard disk carries out paging process with the physical page of hard disk, to form the memory page of the hard disk of the physical page comprising at least one hard disk; The corresponding data block of each memory page.Namely each hard disk comprises multiple memory page, and each memory page comprises at least one physical page, and such Same Physical page only can store same data block.Generate data block overall situation page number according to the memory page of data block, the size according to data block generates data block number of pages.
When the data fetch device 30 of this preferred embodiment uses, first address acquisition module 31 obtains the address number of data block.Then the address number of data block that obtains according to address acquisition module 31 of index acquisition module 32 and data directory 36, obtain the index content in data directory 36.For the ease of obtaining the data directory 36 of data block fast, address number and the corresponding index content of data block store with the form of key-value.Also can there is by the data of index content the hard disc data identifying and judge whether that existence is corresponding with index content in the verification unit of index acquisition module 32 simultaneously, data existence as index content is designated no, then the direct return address of verification unit number wrong prompting; Data as index content exist and are designated and are, then verification unit returns the data block number of pages of index content and data block overall situation page number to position acquisition module 33.
The data block overall situation page number that subsequent position acquisition module 33 obtains according to index acquisition module 32 and the hard disk quantity 37 of electronic equipment, obtain hard disk reel number and the data block local page number of data block.Because final digital independent reads from the hard disk storing data block, therefore according to the data block overall situation page number of data block and the hard disk quantity 37 of electronic equipment, concrete place hard disk and concrete position (i.e. the data block local page number) of data block is obtained.Here write with hard disk that (namely 1 number block writes 1 dialer in turn, 2 number blocks write 2 dialers) be example, hard disk quantity as electronic equipment is 8, and the data block overall situation page number of data block is 81, then the hard disk reel number=data block overall situation page number % hard disk quantity=81%8=1 of data block; Data block local page number=[data block overall situation page number/hard disk quantity]=8.Such position acquisition module 33 can obtain the hard disk reel number of data block and data block local page number (having uniqueness in all data blocks local page number of certain hard disk that this data block local page number sets at electronics) fast.
Then request submits to module 34 according to the data block number of pages of data block, hard disk reel number and data block local page number, submits the asynchronous read requests of data block to.Wherein data block number of pages represents the size of data block, the size=data block number of pages * memory page size of data block; Hard disk reel number and data block local page number represent the particular location of data block.
Last after operating system read block, owing to getting this data block, the asynchronous read requests that callback module 35 can submit to module to submit to according to request, adjusts back in corresponding treatment scheme, proceeds the application process in flow process.Namely the application process in treatment scheme can enter in the sleep queue of wait after sending asynchronous read requests to operating system; After operating system reads this data block, application process meeting Timed Recovery or readjustment, use this data block to proceed operation.
So namely, complete the data read process of the data fetch device 30 of this preferred embodiment.
Preferably, in the data fetch device 30 of this preferred embodiment, data directory 36 also can comprise index stem, and index stem comprises the use information of hard disk, the use information of index and shared label information.The use information of hard disk comprises hard disk quantity, hard disk number of pages, hard disk page size and current additional page number; The use information of index comprises the index quantity and untapped index quantity that have used; Shared label information comprises magic number and usage flag.Wherein hard disk quantity represents the hard disk quantity of electronic equipment, hard disk number of pages represents the quantity of the physical page of the hard disk of electronic equipment, hard disk page size represents the size of the physical page of the hard disk of electronic equipment, and current additional page number represents the page number of the untapped physical page of the hard disk of electronic equipment.Evil spirit number is for representing the validity (as the data in data directory portion are tampered, then this magic number can change) of the data in this data directory portion, and usage flag is for representing data directory using state (using state or unused state).The service condition of hard disk and index can be obtained accurately by this index stem user, and data validity in data directory portion and using state.
Preferably, the stem of the data block read at the data fetch device 30 of this preferred embodiment also can comprise the School Affairs of data, data block overall situation page number and data actual length.Wherein the School Affairs of data is used for the validity (whether being tampered) of checking data block, and data block overall situation page number, for representing the data block overall situation page number of this data block, can compare with the data block overall situation page number in index content, to guarantee the validity of data.Data actual length is used for obtaining data block accurately, during owing to carrying out digital independent, be all the elements at least one memory page of disposable reading, and data block often can not use whole memory page, is therefore Existential Space fragment in part memory page.According to the data actual length of Data Block Header, the space junk in memory page can be removed from data block, thus the content of data block can be obtained accurately.
Data fetch device of the present invention obtains the position of corresponding data block by data directory, and each memory page only a corresponding data block can accelerate reading and the write operation of data block, solve existing data fetch device and easily block application process, cause application process effectively cannot utilize the computational resource of equipment and the technical matters of storage resources.
Please refer to Fig. 3 and Fig. 4, Fig. 4 is the process flow diagram of the preferred embodiment of method for reading data of the present invention.The method for reading data of this preferred embodiment can use above-mentioned data fetch device 30 to implement.The method for reading data of this preferred embodiment comprises:
Step S401, obtains the address number of data block;
Step S402, according to address number and data directory, obtains the index content in data directory;
Step S403, according to described data block overall situation page number and hard disk quantity, obtains hard disk reel number and the data block local page number of data block;
Step S404, according to data block number of pages, hard disk reel number and data block local page number, submits the asynchronous read requests of data block to;
Step S405, after operating system read block, according to asynchronous read requests, adjusts back in corresponding treatment scheme;
The method for reading data of this preferred embodiment ends at step S405.
The following detailed description of the idiographic flow of each step of the method for reading data of this preferred embodiment.
In the method for reading data of this preferred embodiment, hard disk carries out paging process with the physical page of hard disk, to form the memory page of the hard disk of the physical page comprising at least one hard disk; The corresponding data block of each memory page.Namely each hard disk comprises multiple memory page, and each memory page comprises at least one physical page, and such Same Physical page only can store same data block.Generate data block overall situation page number according to the memory page of data block, the size according to data block generates data block number of pages.
In step S401, address acquisition module 31 obtains the address number of data block.Forward step S402 to subsequently.
In step S402, the address number of the data block that index acquisition module 32 obtains according to address acquisition module 31 and data directory 36, obtain the index content in data directory 36.For the ease of obtaining the data directory 36 of data block fast, address number and the corresponding index content of data block store with the form of key-value.Also can there is by the data of index content the hard disc data identifying and judge whether that existence is corresponding with index content in the verification unit of index acquisition module 32 simultaneously, data existence as index content is designated no, then the direct return address of verification unit number wrong prompting; Data as index content exist and are designated and are, then verification unit returns the data block number of pages of index content and data block overall situation page number to position acquisition module 33.Forward step S403 to subsequently.
In step S403, the data block overall situation page number that position acquisition module 33 obtains according to index acquisition module 32 and the hard disk quantity 37 of electronic equipment, obtain hard disk reel number and the data block local page number of data block.Because final digital independent reads from the hard disk storing data block, therefore according to the data block overall situation page number of data block and the hard disk quantity 37 of electronic equipment, concrete place hard disk and concrete position (i.e. the data block local page number) of data block is obtained.Here write with hard disk that (namely 1 number block writes 1 dialer in turn, 2 number blocks write 2 dialers) be example, hard disk quantity as electronic equipment is 8, and the data block overall situation page number of data block is 81, then the hard disk reel number=data block overall situation page number % hard disk quantity=81%8=1 of data block; Data block local page number=[data block overall situation page number/hard disk quantity]=8.Such position acquisition module 33 can obtain the hard disk reel number of data block and data block local page number (having uniqueness in all data blocks local page number of certain hard disk that this data block local page number sets at electronics) fast.Forward step S404 to subsequently.
In step s 404, request submits to module 34 according to the data block number of pages of data block, hard disk reel number and data block local page number, submits the asynchronous read requests of data block to.Wherein data block number of pages represents the size of data block, the size=data block number of pages * memory page size of data block; Hard disk reel number and data block local page number represent the particular location of data block.Forward step S405 to subsequently.
In step S405, after operating system read block, owing to getting this data block, the asynchronous read requests that callback module 35 can submit to module to submit to according to request, adjusts back in corresponding treatment scheme, proceeds the application process in flow process.Namely the application process in treatment scheme can enter in the sleep queue of wait after sending asynchronous read requests to operating system; After operating system reads this data block, application process meeting Timed Recovery or readjustment, use this data block to proceed operation.
So namely, complete the data read process of the method for reading data of this preferred embodiment.
Preferably, in the method for reading data of this preferred embodiment, data directory 36 also can comprise index stem, and index stem comprises the use information of hard disk, the use information of index and shared label information.The use information of hard disk comprises hard disk quantity, hard disk number of pages, hard disk page size and current additional page number; The use information of index comprises the index quantity and untapped index quantity that have used; Shared label information comprises magic number and usage flag.Wherein hard disk quantity represents the hard disk quantity of electronic equipment, hard disk number of pages represents the quantity of the physical page of the hard disk of electronic equipment, hard disk page size represents the size of the physical page of the hard disk of electronic equipment, and current additional page number represents the page number of the untapped physical page of the hard disk of electronic equipment.Evil spirit number is for representing the validity (as the data in data directory portion are tampered, then this magic number can change) of the data in this data directory portion, and usage flag is for representing data directory using state (using state or unused state).The service condition of hard disk and index can be obtained accurately by this index stem user, and data validity in data directory portion and using state.
Preferably, the stem of the data block read at the method for reading data of this preferred embodiment also can comprise the School Affairs of data, data block overall situation page number and data actual length.Wherein the School Affairs of data is used for the validity (whether being tampered) of checking data block, and data block overall situation page number, for representing the data block overall situation page number of this data block, can compare with the data block overall situation page number in index content, to guarantee the validity of data.Data actual length is used for obtaining data block accurately, during owing to carrying out digital independent, be all the elements at least one memory page of disposable reading, and data block often can not use whole memory page, is therefore Existential Space fragment in part memory page.According to the data actual length of Data Block Header, the space junk in memory page can be removed from data block, thus the content of data block can be obtained accurately.
Method for reading data of the present invention obtains the position of corresponding data block by data directory, and each memory page only a corresponding data block can accelerate reading and the write operation of data block, solve existing method for reading data and easily block application process, cause application process effectively cannot utilize the computational resource of equipment and the technical matters of storage resources.
Please refer to Fig. 5, Fig. 5 is the structural representation of the preferred embodiment of data transfer apparatus of the present invention.The data transfer apparatus 50 of this preferred embodiment can be arranged in above-mentioned electronic equipment 112, and it comprises position acquisition module 51, index generation module 52, position generation module 53, writing module 54 and update module 55.Position acquisition module 51, for according to data directory 56, obtains the data block overall situation page number of the memory page of the blank of hard disk; Index generation module 52, for the data block overall situation page number of the memory page according to data block 57 and blank, generates the index content corresponding with data block and address number, and wherein index content comprises data block number of pages, data overall situation page number and data existence mark; Position generation module 53, for according to data block overall situation page number and hard disk quantity 58, generates hard disk reel number and the data block local page number of data block; Writing module 54, for according to data block number of pages, hard disk reel number and data block local page number, submits data block write request to; Update module 55, for the result according to write request, uses index content to upgrade data directory.
Wherein hard disk carries out paging process with the physical page of hard disk, to form the memory page of the hard disk of the physical page comprising at least one hard disk; The corresponding data block of each memory page.Namely each hard disk comprises multiple memory page, and each memory page comprises at least one physical page, and such Same Physical page only can store same data block 57.Generate data block overall situation page number according to the memory page of data block 57, the size according to data block 57 generates data block number of pages.
When the data transfer apparatus 50 of this preferred embodiment uses, first position acquisition module 51 is according to data directory 56, obtains the data block overall situation page number of the memory page of the blank of hard disk.Then index generation module 52 is according to the data block overall situation page number of the memory page of data block 57 and blank, generates the index content corresponding with data block 57 and address number.In order to obtain the data directory 56 of data block 57 during read block 57 fast, address number and the corresponding index content of data block store with the form of key-value.This index content comprises data block number of pages and data overall situation page number, and wherein data block number of pages represents the size of data block 57, the size=data block number of pages * memory page size of data block; Data overall situation page number represents the memory location of data block 57.
The data block overall situation page number that subsequent position generation module 53 generates according to index generation module 52 and the hard disk quantity 58 of electronic equipment, generate hard disk reel number and the data block local page number of data block.Owing to being perform in certain hard disk when final data write, therefore according to the data block overall situation page number of generation and the hard disk quantity 58 of electronic equipment, generate concrete write hard disk and the concrete writing position (i.e. data block local page number) of data block 57.Here write with hard disk that (namely 1 number block writes 1 dialer in turn, 2 number blocks write 2 dialers) be example, hard disk quantity as electronic equipment is 8, and the data block overall situation page number of data block 57 is 81, then the hard disk reel number=data block overall situation page number % hard disk quantity=81%8=1 of data block; Data block local page number=[data block overall situation page number/hard disk quantity]=8.Such position generation module can obtain the hard disk reel number of writing data blocks 57 and data block local page number (having uniqueness in all data blocks local page number of certain hard disk that this data block local page number sets at electronics) fast.
Then writing module 54 is for according to data block number of pages, hard disk reel number and data block local page number, submits data block write request to.Wherein data block number of pages represents the size of writing data blocks 57, the size=data block number of pages * memory page size of data block; Hard disk reel number and data block local page number represent the concrete writing position of data block.
Final updating module 55, according to the result of write request, uses index content to upgrade data directory 56.Data block 57 as writing module 54 writes successfully, then update module 55 can use index content to upgrade data directory 56, namely upgrades data block number of pages and the data block overall situation page number of index content corresponding to writing data blocks 57 in data directory 56.There is mark, to represent that hard disc data corresponding to index content successfully writes hard disk in the data of the identification generation unit meeting generating indexes content of update module 55 simultaneously.Data block as writing module 54 writes unsuccessfully, then update module 55 does not upgrade data directory.
So namely, complete the data writing process of the data transfer apparatus 50 of this preferred embodiment.
Preferably, in the data transfer apparatus of this preferred embodiment, data directory 56 also can comprise index stem, and index stem comprises the use information of hard disk, the use information of index and shared label information.The use information of hard disk comprises hard disk quantity 58, hard disk number of pages, hard disk page size and current additional page number; The use information of index comprises the index quantity and untapped index quantity that have used; Shared label information comprises magic number and usage flag.Wherein hard disk quantity 58 represents the hard disk quantity of electronic equipment, hard disk number of pages represents the quantity of the physical page of the hard disk of electronic equipment, hard disk page size represents the size of the physical page of the hard disk of electronic equipment, and current additional page number represents the page number of the untapped physical page of the hard disk of electronic equipment.Evil spirit number is for representing the validity (as the data in data directory portion are tampered, then this magic number can change) of the data in this data directory portion, and usage flag is for representing data directory using state (using state or unused state).The service condition of hard disk and index can be obtained accurately by this index stem user, and data validity in data directory portion and using state.
Preferably, the stem of the data block 57 write at the data transfer apparatus of this preferred embodiment also can comprise the School Affairs of data, data block overall situation page number and data actual length.Wherein the School Affairs of data is used for the validity (whether being tampered) of checking data block 57, data block overall situation page number is for representing the data block overall situation page number of this data block, can compare with the data block overall situation page number in index content, to guarantee the validity of data.Data actual length is used for obtaining data block 57 accurately, during owing to carrying out digital independent, be all the elements at least one memory page of disposable reading, and data block 57 often can not use whole memory page, is therefore Existential Space fragment in part memory page.According to the data actual length of Data Block Header, the space junk in memory page can be removed from data block, thus the content of data block 57 can be obtained accurately when reading these data.
Data transfer apparatus of the present invention generates the position of corresponding data block by setting up data directory, and each memory page only a corresponding data block can accelerate reading and the write operation of data block, solve existing method for reading data and easily block application process, cause application process effectively cannot utilize the computational resource of equipment and the technical matters of storage resources.
Please refer to Fig. 5 and Fig. 6, Fig. 6 is the structural representation of the preferred embodiment of data transfer apparatus of the present invention.The method for writing data of this preferred embodiment can use above-mentioned data transfer apparatus 50 to implement.The method for writing data of this preferred embodiment comprises:
Step S601, according to data directory, obtains the data block overall situation page number of the memory page of the blank of hard disk;
Step S602, according to the data block overall situation page number of the memory page of data block and blank, generates the index content corresponding with data block and address number;
Step S603, according to data block overall situation page number and hard disk quantity, generates hard disk reel number and the data block local page number of data block;
Step S604, according to data block number of pages, hard disk reel number and data block local page number, submits data block write request to;
Step S605, according to the result of write request, uses index content to upgrade data directory;
The method for writing data of this preferred embodiment ends at step S605.
The following detailed description of the idiographic flow of each step of the method for writing data of this preferred embodiment.
In the method for writing data of this preferred embodiment, hard disk carries out paging process with the physical page of hard disk, to form the memory page of the hard disk of the physical page comprising at least one hard disk; The corresponding data block of each memory page.Namely each hard disk comprises multiple memory page, and each memory page comprises at least one physical page, and such Same Physical page only can store same data block.Generate data block overall situation page number according to the memory page of data block, the size according to data block generates data block number of pages.
In step s 601, position acquisition module 51, according to data directory 56, obtains the data block overall situation page number of the memory page of the blank of hard disk.Forward step S602 to subsequently.
In step S602, index generation module 52, according to the data block overall situation page number of the memory page of data block 57 and blank, generates the index content corresponding with data block 57 and address number.In order to obtain the data directory 56 of data block 57 during read block 57 fast, address number and the corresponding index content of data block 57 store with the form of key-value.This index content comprises data block number of pages and data overall situation page number, and wherein data block number of pages represents the size of data block 57, the size=data block number of pages * memory page size of data block; Data overall situation page number represents the memory location of data block 57.Forward step S603 to subsequently.
In step S603, the data block overall situation page number that position generation module 53 generates according to index generation module 52 and the hard disk quantity 58 of electronic equipment, generate hard disk reel number and the data block local page number of data block.Owing to being perform in certain hard disk when final data write, therefore according to the data block overall situation page number of generation and the hard disk quantity 58 of electronic equipment, generate concrete write hard disk and the concrete writing position (i.e. data block local page number) of data block 57.Here write with hard disk that (namely 1 number block writes 1 dialer in turn, 2 number blocks write 2 dialers) be example, hard disk quantity as electronic equipment is 8, and the data block overall situation page number of data block is 81, then the hard disk reel number=data block overall situation page number % hard disk quantity=81%8=1 of data block; Data block local page number=[data block overall situation page number/hard disk quantity]=8.Such position generation module can obtain the hard disk reel number of writing data blocks 57 and data block local page number (having uniqueness in all data blocks local page number of certain hard disk that this data block local page number sets at electronics) fast.Forward step S604 to subsequently.
In step s 604, writing module 54, for according to data block number of pages, hard disk reel number and data block local page number, submits data block write request to.Wherein data block number of pages represents the size of writing data blocks 57, the size=data block number of pages * memory page size of data block; Hard disk reel number and data block local page number represent the concrete writing position of data block.Forward step S605 to subsequently.
In step s 605, update module 55, according to the result of write request, uses index content to upgrade data directory 56.Data block 57 as writing module 54 writes successfully, then update module 55 can use index content to upgrade data directory 56, namely upgrades data block number of pages and the data block overall situation page number of index content corresponding to writing data blocks 57 in data directory 56.There is mark, to represent that hard disc data corresponding to index content successfully writes hard disk in the data of the identification generation unit meeting generating indexes content of update module 55 simultaneously.Data block as writing module 54 writes unsuccessfully, then update module 55 does not upgrade data directory.
So namely, complete the data writing process of the method for writing data of this preferred embodiment.
Preferably, in the method for writing data of this preferred embodiment, data directory 56 also can comprise index stem, and index stem comprises the use information of hard disk, the use information of index and shared label information.The use information of hard disk comprises hard disk quantity 58, hard disk number of pages, hard disk page size and current additional page number; The use information of index comprises the index quantity and untapped index quantity that have used; Shared label information comprises magic number and usage flag.Wherein hard disk quantity 58 represents the hard disk quantity of electronic equipment, hard disk number of pages represents the quantity of the physical page of the hard disk of electronic equipment, hard disk page size represents the size of the physical page of the hard disk of electronic equipment, and current additional page number represents the page number of the untapped physical page of the hard disk of electronic equipment.Evil spirit number is for representing the validity (as the data in data directory portion are tampered, then this magic number can change) of the data in this data directory portion, and usage flag is for representing data directory using state (using state or unused state).The service condition of hard disk and index can be obtained accurately by this index stem user, and data validity in data directory portion and using state.
Preferably, the stem of the data block 57 write at the method for writing data of this preferred embodiment also can comprise the School Affairs of data, data block overall situation page number and data actual length.Wherein the School Affairs of data is used for the validity (whether being tampered) of checking data block 57, data block overall situation page number is for representing the data block overall situation page number of this data block, can compare with the data block overall situation page number in index content, to guarantee the validity of data.Data actual length is used for obtaining data block 57 accurately, during owing to carrying out digital independent, be all the elements at least one memory page of disposable reading, and data block 57 often can not use whole memory page, is therefore Existential Space fragment in part memory page.According to the data actual length of Data Block Header, the space junk in memory page can be removed from data block, thus the content of data block 57 can be obtained accurately when reading these data.
Method for writing data of the present invention generates the position of corresponding data block by setting up data directory, and each memory page only a corresponding data block can accelerate reading and the write operation of data block, solve existing method for reading data and easily block application process, cause application process effectively cannot utilize the computational resource of equipment and the technical matters of storage resources.
Please refer to Fig. 7, Fig. 7 is the process flow diagram of the specific embodiment of method for writing data of the present invention and device.Below by the specific embodiment shown in Fig. 7, the method for writing data of this preferred embodiment and the specific works principle of device are described.
Step S701, application process is according to the data block overall situation page number of the memory page of data block and blank, and generate the index content corresponding with data block and address number, the scope of address number can be 0 to (index total quantity-1).
Step S702, according to the hard disk quantity of index content and electronic equipment, generates hard disk reel number and the data block local page number of data block, namely determines size and the position of data block.
Step S703, processes data block, namely at School Affairs, the data block overall situation page number and data actual length of the stem setting data of data block.
Step S704, by the data block after process, is sequentially written in hard disk by the hard disk reel number of data block generated and data block local page number.
Step S705, according to the result of write, upgrades the index content corresponding with address number.
Please refer to Fig. 8, Fig. 8 is the process flow diagram of the specific embodiment of method for reading data of the present invention and device.Below by the specific embodiment shown in Fig. 8, the method for reading data of this preferred embodiment and the specific works principle of device are described.
Step S801, according to the address number of data block, obtains the data block number of pages in index content, data overall situation page number and data and there is mark.
, there is mark according to data in step S802, judges whether hard disc data corresponding to index content writes.
Step S803, as data existence is designated no, then directly returns error code; Then data block overall situation page number is converted to hard disk reel number and the data block local page number of data block as data exist to be designated.
Step S804, according to the data block number of pages of data block, hard disk reel number and data block local page number, submits asynchronous read requests to operating system.
Step S805, corresponding treatment scheme enters in the sleep queue of wait;
Step S806, operating system is adjusted back in corresponding treatment scheme after processing this asynchronous read requests.
Table 2 is for using the concurrency situation of the server after digital independent of the present invention, wiring method and device.
Table 2
Server A concurrency Server B concurrency
Synchronous read-write 350 300
Asynchronous read and write 610 540
The present invention 700 620
As seen from the above table, digital independent of the present invention, wiring method and device and data store organisation make use of computational resource and the storage resources of hardware server fully, the problem of application process is easily blocked when solving existing read operation and write operation, improve the performance of server, effect is better than simple synchronous read-write and asynchronous read and write, achieves the concurrent and height of the height of server processes and handles up.
Digital independent of the present invention, wiring method and device and data store organisation obtain the position of corresponding data block by data directory, and each memory page only a corresponding data block can accelerate reading and the write operation of data block, solve existing digital independent, wiring method and device and easily block application process, cause application process effectively cannot utilize the computational resource of equipment and the technical matters of storage resources.
Each functional unit in the embodiment of the present invention can be integrated in a processing module, also can be that the independent physics of unit exists, also can be integrated in a module by two or more unit.Above-mentioned integrated module both can adopt the form of hardware to realize, and the form of software function module also can be adopted to realize.If described integrated module using the form of software function module realize and as independently production marketing or use time, also can be stored in a computer read/write memory medium.The above-mentioned storage medium mentioned can be ROM (read-only memory), disk or CD etc.Above-mentioned each device or system, can perform the method in correlation method embodiment.
In sum; although the present invention discloses as above with preferred embodiment; but above preferred embodiment is also not used to limit the present invention; those of ordinary skill in the art; without departing from the spirit and scope of the present invention; all can do various change and retouching, the scope that therefore protection scope of the present invention defines with claim is as the criterion.

Claims (25)

1. a method for reading data, is characterized in that, comprises step:
Obtain the address number of data block;
According to described address number and data directory, obtain the index content in described data directory, wherein said index content comprises data block number of pages and data block overall situation page number;
According to described data block overall situation page number and hard disk quantity, obtain hard disk reel number and the data block local page number of described data block;
According to described data block number of pages, described hard disk reel number and described data block local page number, submit the asynchronous read requests of data block to; And
After operating system read block, according to described asynchronous read requests, adjust back in corresponding treatment scheme;
Wherein said hard disk carries out paging process with the physical page of described hard disk, to form the memory page of the described hard disk of the physical page comprising hard disk described at least one; Data block described in memory page correspondence one described in each; Generate described data block overall situation page number according to the memory page of described data block, generate described data block number of pages according to the size of described data block.
2. method for reading data according to claim 1, is characterized in that, address number and the corresponding index content of described data block store with the form of key-value.
3. method for reading data according to claim 1, is characterized in that, the described index content data also comprised for judging whether to exist the hard disc data corresponding with described index content exist and identify;
The step of the index content in the described data directory of described acquisition comprises:
As described in data as described in index content exist and be designated no, then return described address number mistake; And
As described in data as described in index content to exist to be designated be then return described data block number of pages and the described data block overall situation page number of described index content.
4. method for reading data according to claim 1, is characterized in that, the stem of described data block comprises the School Affairs of data, data block overall situation page number and data actual length.
5. method for reading data according to claim 1, is characterized in that, described data directory also comprises index stem, and described index stem comprises the use information of hard disk, the use information of index and shared label information; The use information of described hard disk comprises hard disk quantity, hard disk number of pages, hard disk page size and current additional page number; The use information of described index comprises the index quantity and untapped index quantity that have used; Described shared label information comprises the magic number for verifying validity and the usage flag for representing described data directory using state.
6. a method for writing data, is characterized in that, comprises step:
According to data directory, obtain the data block overall situation page number of the memory page of the blank of described hard disk;
According to the data block overall situation page number of the memory page of described data block and described blank, generate the index content corresponding with described data block and address number, wherein said index content comprises data block number of pages and the overall page number of data block;
According to described data block overall situation page number and hard disk quantity, generate hard disk reel number and the data block local page number of described data block;
According to described data block number of pages, described hard disk reel number and described data block local page number, submit data block write request to; And
According to the result of said write request, described index content is used to upgrade described data directory;
Wherein said hard disk carries out paging process with the physical page of described hard disk, to form the memory page of the described hard disk of the physical page comprising hard disk described at least one; Data block described in memory page correspondence one described in each; Generate described data block overall situation page number according to the memory page of described data block, generate described data block number of pages according to the size of described data block.
7. method for writing data according to claim 6, is characterized in that, address number and the corresponding index content of described data block store with the form of key-value.
8. method for writing data according to claim 6, is characterized in that, the described index content data also comprised for judging whether to exist the hard disc data corresponding with described index content exist and identify;
Described method for writing data also comprises step:
According to the result of said write request, there is mark in the described data generating described index content.
9. method for writing data according to claim 6, is characterized in that, described method for writing data also comprises step:
Described data block is processed, to generate the stem of described data block; The stem of wherein said data block comprises the School Affairs of data, data block overall situation page number and data actual length.
10. method for writing data according to claim 6, is characterized in that, described data directory also comprises index stem, and described index stem comprises the use information of hard disk, the use information of index and shared label information; The use information of described hard disk comprises hard disk quantity, hard disk number of pages, hard disk page size and current additional page number; The use information of described index comprises the index quantity and untapped index quantity that have used; Described shared label information comprises the magic number for verifying validity and the usage flag for representing described data directory using state.
11. 1 kinds of data store organisations, is characterized in that, comprising:
Data store, comprises multiple hard disk, and described hard disk carries out paging process with the physical page of described hard disk, to form the memory page of the described hard disk of the physical page comprising hard disk described at least one; The wherein corresponding data block of memory page described in each;
Data directory portion, comprises index content, comprising:
Data block number of pages, for representing the size of described data block; And
Data block overall situation page number, for representing the memory location of described data block; And
Address number, corresponding with described index content, for being supplied to user, with read block.
12. data store organisations according to claim 11, is characterized in that, address number and the corresponding index content of described data block store with the form of key-value.
13. data store organisations according to claim 11, is characterized in that, described index content also comprises:
There is mark in data, there is the hard disc data corresponding with described index content for judging whether.
14. data store organisations according to claim 11, is characterized in that, the stem of described data block comprises the School Affairs of data, data block overall situation page number and data actual length.
15. data store organisations according to claim 11, is characterized in that, described data directory portion also comprises index stem, and described index stem comprises the use information of hard disk, the use information of index and shared label information; The use information of described hard disk comprises hard disk quantity, hard disk number of pages, hard disk page size and current additional page number; The use information of described index comprises the index quantity and untapped index quantity that have used; Described shared label information comprises the magic number for verifying validity and the usage flag for representing described data directory using state.
16. 1 kinds of data fetch devices, is characterized in that, comprising:
Address acquisition module, for obtaining the address number of data block;
Index acquisition module, for according to described address number and data directory, obtains the index content in described data directory, and wherein said index content comprises data block number of pages and data block overall situation page number;
Position acquisition module, for according to described data block overall situation page number and hard disk quantity, obtains hard disk reel number and the data block local page number of described data block;
Module is submitted in request to, for according to described data block number of pages, described hard disk reel number and described data block local page number, submits the asynchronous read requests of data block to; And
Callback module, after operating system read block, according to described asynchronous read requests, adjusts back in corresponding treatment scheme;
Wherein said hard disk carries out paging process with the physical page of described hard disk, to form the memory page of the described hard disk of the physical page comprising hard disk described at least one; Data block described in memory page correspondence one described in each; Generate described data block overall situation page number according to the memory page of described data block, generate described data block number of pages according to the size of described data block.
17. data fetch devices according to claim 16, is characterized in that, address number and the corresponding index content of described data block store with the form of key-value.
18. data fetch devices according to claim 16, is characterized in that, the described index content data also comprised for judging whether to exist the hard disc data corresponding with described index content exist and identify;
Described index acquisition module comprises:
Verification unit, for as described in data as described in index content exist and be designated no, then return described address number mistake; As described in data as described in index content to exist to be designated be then return described data block number of pages and the described data block overall situation page number of described index content.
19. data fetch devices according to claim 16, is characterized in that, the stem of described data block comprises the School Affairs of data, data block overall situation page number and data actual length.
20. data fetch devices according to claim 16, is characterized in that, described data directory also comprises index stem, and described index stem comprises the use information of hard disk, the use information of index and shared label information; The use information of described hard disk comprises hard disk quantity, hard disk number of pages, hard disk page size and current additional page number; The use information of described index comprises the index quantity and untapped index quantity that have used; Described shared label information comprises the magic number for verifying validity and the usage flag for representing described data directory using state.
21. 1 kinds of data transfer apparatus, is characterized in that, comprising:
Position acquisition module, for according to data directory, obtains the data block overall situation page number of the memory page of the blank of described hard disk;
Index generation module, for the data block overall situation page number of the memory page according to described data block and described blank, generates the index content corresponding with described data block and address number, and wherein said index content comprises data block number of pages and data block overall situation page number;
Position generation module, for according to described data block overall situation page number and hard disk quantity, generates hard disk reel number and the data block local page number of described data block;
Writing module, for according to described data block number of pages, described hard disk reel number and described data block local page number, submits data block write request to; And
Update module, for the result according to said write request, uses described index content to upgrade described data directory;
Wherein said hard disk carries out paging process with the physical page of described hard disk, to form the memory page of the described hard disk of the physical page comprising hard disk described at least one; Data block described in memory page correspondence one described in each; Generate described data block overall situation page number according to the memory page of described data block, generate described data block number of pages according to the size of described data block.
22. data transfer apparatus according to claim 21, is characterized in that, address number and the corresponding index content of described data block store with the form of key-value.
23. data transfer apparatus according to claim 21, is characterized in that, the described index content data also comprised for judging whether to exist the hard disc data corresponding with described index content exist and identify;
Described update module comprises:
Identification generation unit, for the result according to said write request, there is mark in the described data generating described index content.
24. data transfer apparatus according to claim 21, is characterized in that, the stem of described data block comprises the School Affairs of data, data block overall situation page number and data actual length.
25. data transfer apparatus according to claim 21, is characterized in that, described data directory also comprises index stem, and described index stem comprises the use information of hard disk, the use information of index and shared label information; The use information of described hard disk comprises hard disk quantity, hard disk number of pages, hard disk page size and current additional page number; The use information of described index comprises the index quantity and untapped index quantity that have used; Described shared label information comprises the magic number for verifying validity and the usage flag for representing described data directory using state.
CN201310534962.0A 2013-10-31 2013-10-31 Digital independent, wiring method and device and data store organisation Active CN104598161B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310534962.0A CN104598161B (en) 2013-10-31 2013-10-31 Digital independent, wiring method and device and data store organisation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310534962.0A CN104598161B (en) 2013-10-31 2013-10-31 Digital independent, wiring method and device and data store organisation

Publications (2)

Publication Number Publication Date
CN104598161A true CN104598161A (en) 2015-05-06
CN104598161B CN104598161B (en) 2018-10-30

Family

ID=53123989

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310534962.0A Active CN104598161B (en) 2013-10-31 2013-10-31 Digital independent, wiring method and device and data store organisation

Country Status (1)

Country Link
CN (1) CN104598161B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107391030A (en) * 2017-06-26 2017-11-24 广州日滨科技发展有限公司 Date storage method, device, computer-readable recording medium and computer equipment
CN107844273A (en) * 2017-11-01 2018-03-27 深信服科技股份有限公司 A kind of method for writing data and device, verification method and device
CN107924291A (en) * 2015-10-19 2018-04-17 株式会社日立制作所 Storage system
CN108427675A (en) * 2017-02-13 2018-08-21 阿里巴巴集团控股有限公司 Build the method and apparatus of index
CN108829571A (en) * 2018-05-23 2018-11-16 四川巧夺天工信息安全智能设备有限公司 A method of extracting Windows operating system dormant data
CN111309471A (en) * 2018-12-11 2020-06-19 迈普通信技术股份有限公司 Data processing method and device and distributed system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1786893A (en) * 2004-12-10 2006-06-14 国际商业机器公司 Transferring data among a logical layer, physical layer, and storage device
CN101256535A (en) * 2007-03-01 2008-09-03 创惟科技股份有限公司 Apparatus and method for reading-writing and rapidly fetching hard disk data
CN101620517A (en) * 2009-08-04 2010-01-06 成都市华为赛门铁克科技有限公司 Data-writing method and data-writing device
US20110276744A1 (en) * 2010-05-05 2011-11-10 Microsoft Corporation Flash memory cache including for use with persistent key-value store
CN103207836A (en) * 2012-01-16 2013-07-17 百度在线网络技术(北京)有限公司 Write method and write device for solid-state storage hard disk
CN103257831A (en) * 2012-02-20 2013-08-21 深圳市腾讯计算机系统有限公司 Reading-writing control method of storage and corresponding storage

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1786893A (en) * 2004-12-10 2006-06-14 国际商业机器公司 Transferring data among a logical layer, physical layer, and storage device
CN101256535A (en) * 2007-03-01 2008-09-03 创惟科技股份有限公司 Apparatus and method for reading-writing and rapidly fetching hard disk data
CN101620517A (en) * 2009-08-04 2010-01-06 成都市华为赛门铁克科技有限公司 Data-writing method and data-writing device
US20110276744A1 (en) * 2010-05-05 2011-11-10 Microsoft Corporation Flash memory cache including for use with persistent key-value store
CN103207836A (en) * 2012-01-16 2013-07-17 百度在线网络技术(北京)有限公司 Write method and write device for solid-state storage hard disk
CN103257831A (en) * 2012-02-20 2013-08-21 深圳市腾讯计算机系统有限公司 Reading-writing control method of storage and corresponding storage

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107924291A (en) * 2015-10-19 2018-04-17 株式会社日立制作所 Storage system
CN107924291B (en) * 2015-10-19 2020-10-09 株式会社日立制作所 Storage system
CN108427675A (en) * 2017-02-13 2018-08-21 阿里巴巴集团控股有限公司 Build the method and apparatus of index
CN107391030A (en) * 2017-06-26 2017-11-24 广州日滨科技发展有限公司 Date storage method, device, computer-readable recording medium and computer equipment
CN107391030B (en) * 2017-06-26 2020-04-28 日立楼宇技术(广州)有限公司 Data storage method, data storage device, computer-readable storage medium and computer equipment
CN107844273A (en) * 2017-11-01 2018-03-27 深信服科技股份有限公司 A kind of method for writing data and device, verification method and device
CN107844273B (en) * 2017-11-01 2021-05-04 深信服科技股份有限公司 Data writing method and device and verification method and device
CN108829571A (en) * 2018-05-23 2018-11-16 四川巧夺天工信息安全智能设备有限公司 A method of extracting Windows operating system dormant data
CN108829571B (en) * 2018-05-23 2021-07-27 四川巧夺天工信息安全智能设备有限公司 Method for extracting dormant data of Windows operating system
CN111309471A (en) * 2018-12-11 2020-06-19 迈普通信技术股份有限公司 Data processing method and device and distributed system
CN111309471B (en) * 2018-12-11 2024-02-09 迈普通信技术股份有限公司 Data processing method, device and distributed system

Also Published As

Publication number Publication date
CN104598161B (en) 2018-10-30

Similar Documents

Publication Publication Date Title
US11403044B2 (en) Method and apparatus for performing multi-object transformations on a storage device
CN106796490B (en) Hardware automation for memory management
JP4424965B2 (en) Method and apparatus for effectively enabling an out-of-sequence write process in a non-volatile memory system
CN104598161A (en) Data reading and writing method and device and data storage structure
KR20190087217A (en) Data storage device and operating method thereof
CN106372004B (en) Programmable protocol independent BAR memory for SSD controller
US20210208988A1 (en) Memory management
CN102473078B (en) For reading the controller of data from nonvolatile memory
US8347052B2 (en) Initializing of a memory area
CN106372011B (en) High performance host queue monitor for PCIE SSD controller
CN106920575B (en) Data storage device and operation method thereof
US8886885B2 (en) Systems and methods for operating a plurality of flash modules in a flash memory file system
KR20190083148A (en) Data storage device and operating method thereof and data process system containing the same
CN109725850B (en) Memory system and memory device
KR20190019712A (en) Data storage device and operating method thereof
US20150199201A1 (en) Memory system operating method providing hardware initialization
CN104572638A (en) Data reading and writing method and device
CN111782153A (en) Method, system, device and medium based on read data
CN112950456A (en) Image processing method and device, electronic equipment and computer readable medium
US20150120991A1 (en) Data processing system and operating method thereof
US20230297274A1 (en) Apparatus and method for transfering data in memory system
CN112771490A (en) Addressing in memory by Reading Identification (RID) numbers
US10108377B2 (en) Storage processing unit arrays and methods of use
US20120131236A1 (en) Communication between a computer and a data storage device
CN107436918A (en) Database implementation method, device and 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
GR01 Patent grant
GR01 Patent grant