CN104375781A - Data access method and device - Google Patents
Data access method and device Download PDFInfo
- Publication number
- CN104375781A CN104375781A CN201310359608.9A CN201310359608A CN104375781A CN 104375781 A CN104375781 A CN 104375781A CN 201310359608 A CN201310359608 A CN 201310359608A CN 104375781 A CN104375781 A CN 104375781A
- Authority
- CN
- China
- Prior art keywords
- file
- data access
- physical storage
- storage locations
- identifier
- 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
Links
Classifications
-
- G—PHYSICS
- G11—INFORMATION STORAGE
- G11B—INFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
- G11B27/00—Editing; Indexing; Addressing; Timing or synchronising; Monitoring; Measuring tape travel
- G11B27/10—Indexing; Addressing; Timing or synchronising; Measuring tape travel
- G11B27/102—Programmed access in sequence to addressed parts of tracks of operating record carriers
- G11B27/105—Programmed access in sequence to addressed parts of tracks of operating record carriers of operating discs
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
A data access method includes: loading a data access interface to acquire physical storage position information of at least one file in a storage, calling the data access interface, acquiring the physical storage positon information of at least two files according to identifiers of the files, planning file access operations to be performed, according to the physical storage positon information to satisfy an access mode meeting expectations, and performing the file access operations correspondingly. In addition, the invention further provides a data access device. The data access method and device has the advantages that data access speed can be increased more effectively, and wear of a head drive mechanism is reduced.
Description
Technical field
The present invention relates to memory technology, particularly relate to a kind of data access method and device.
Background technology
In memory technology, the accessing operation of file system is had to portable operating system interface (English: Portable Operating System Interface, the abbreviation: POSIX), also have the interface that standard C language provides of standard.POSIX interface defines read and write interface, and standard C language provides fread and fwrite interface.These two kinds of modes, as the most general interface, are used widely.
In prior art, the accessing operation of file system is substantially all based on hard disk, and hard disk is as mechanical electronic equipment, and magnetic head moves and needs the time, short apart from short traveling time, and the traveling time of distance is long.And existing interface does not all consider the correlativity of accessing operation in physical space, if continuous print twice access file physical distance is comparatively far away, then magnetic head displacement is long, and elapsed time is long, and access speed is slow, and increases the wearing and tearing of magnetic head driving mechanism.
Summary of the invention
In view of this, the invention provides a kind of data access method and device, effectively can improve the access speed of data, and reduce the wearing and tearing of magnetic head driving mechanism.
The data access method that the embodiment of the present invention provides, comprising:
Load data access interface, this data access interface is for obtaining at least one file physical storage locations information in memory;
Obtain the identifier of at least two files;
Call this data access interface, make this data access interface obtain the physical storage locations information of these at least two files according to this identifier;
The file access operations making a reservation for according to this physical storage locations information planning to carry out to meet the access mode of expection, and correspondingly carries out file access operations.
The data access arrangement that the embodiment of the present invention provides, comprising:
Data access interface, for obtaining at least one file physical storage locations information in memory;
Acquiring unit, for obtaining the identifier of at least two files;
Interface interchange unit, for calling this data access interface, obtains the physical storage locations information of these at least two files according to this identifier obtained;
Access unit, for this physical storage locations information obtained according to described acquiring unit, the predetermined file access operations that will carry out of planning to meet the access mode of expection, and correspondingly carries out file access operations.
The data access method that the embodiment of the present invention provides and device, data access interface is provided, this data access interface is for obtaining the physical storage locations information of at least one file, obtain the identifier of at least two files, call this data access interface, the physical storage locations information of this one or more file is obtained according to this identifier, the file access operations making a reservation for according to this physical storage locations information planning to carry out is to meet the access mode of expection, and correspondingly carry out file access operations, during due to accessing file, the actual physical location planning file access order stored according to file, the time of access data can be reduced, accelerate access speed, the wearing and tearing of magnetic head driving mechanism can be reduced simultaneously.
For above and other object of the present invention, feature and advantage can be become apparent, preferred embodiment cited below particularly, and coordinate institute's accompanying drawings, be described in detail below.
Accompanying drawing explanation
The data access method process flow diagram that Fig. 1 provides for the first embodiment.
Fig. 2 is the data access method schematic diagram of the first embodiment.
The data access arrangement structured flowchart that Fig. 3 provides for the first embodiment.
Embodiment
For further setting forth the present invention for the technological means that realizes predetermined goal of the invention and take and effect, below in conjunction with accompanying drawing and preferred embodiment, to according to the specific embodiment of the present invention, structure, feature and effect thereof, be described in detail as follows.
The embodiment of the present invention provides a kind of data access method, is particularly useful for realizing the storer of access as hard disk or CD based on magnetic head.It effectively can improve the access speed of data in magnetic disk, and reduces the wearing and tearing of magnetic head driving mechanism
The file system of computing machine is a kind of method of storage and organizational computing machine data, it makes the access of data and searches and become easy, file system uses the abstract logic concept of file and directory tree to instead of the concept of the data block that the physical equipments such as hard disk/CD use, and does not know that the actual address being kept at hard disk (or CD) of data is in how many data blocks when user uses file system to preserve data.Before write new data, also need not be concerned about that block address on hard disk is not used, storage space management (distributing and the release) function on hard disk is completed automatically by file system.
When file system creates (format), just storage area is divided into different storage areas.One of them region is used for preserving the storage information of file system object (file or catalogue), and file itself can be stored in other storage areas.For class Unix file system, above-mentioned region is used to the metamessage data (Metadata) of stores file system objects; And for FAT file system, this region is used to storage file allocation table (File Allocation Table).But no matter being which kind of operating system, all can knowing the physical storage locations of a file in storer by inquiring about above-mentioned metamessage data and file allocation table etc.
The embodiment of the present invention provides a kind of data access interface, and it is for obtaining the physical storage locations information of at least one file.Be appreciated that the specific implementation process of this data access interface is as follows: first, obtain the identifier (as filename) of the file that will inquire about; Then the storage information that above-mentioned metamessage data or file allocation table etc. obtain this file is inquired about; Physical storage locations information can be obtained according to this storage information.Be appreciated that the restriction due to file system, a file memory location physically may be discontinuous, and therefore the memory location of a file may have multiple in fact.But for above-mentioned data access interface, its physical storage locations information can be the position that the actual storage only comprising this file starts.
Be appreciated that above-mentioned data access interface can adopt any suitable programming language to realize.In one embodiment, above-mentioned data access interface realizes based on standard C language.
In an example, above-mentioned data access interface, only supports the physical storage locations information of an inquiry file.
In another example, above-mentioned data access interface, it can receive a listed files as parameter, and the physical storage locations information of All Files in corresponding backspace file list.
First embodiment
Refer to Fig. 1, the data access method that the first embodiment provides comprises:
Step 101, loading data access interface, this data access interface is for obtaining the physical storage locations information of at least one file.
The identifier of step 102, acquisition at least two files;
In an example, above-mentioned identifier is filename.Be appreciated that in above-mentioned filename and should comprise complete store path.In addition, above-mentioned identifier is not limited to filename, arbitrarily can support by file system, the data being used for inquiring about corresponding file all can be used as above-mentioned identifier.Such as, in an example, above-mentioned identifier is document number (call number).Above-mentioned multiple files are such as the files that will carry out accessing operation in a program in follow-up certain period.
Step 103, call this data access interface, make this data access interface obtain the physical storage locations information of the plurality of file according to this identifier.
If data access interface can only inquire about a file at every turn, then distinguish repeatedly calling data access interface, to obtain the physical storage locations information of each file in multiple file respectively.
If data access interface supports multifile inquiry, then can generate the list of the file that will inquire about, submit to this data access interface as parameter by predetermined form, thus inquire about the physical storage locations information of the plurality of file simultaneously.
Step 104, the file access operations that makes a reservation for according to this physical storage locations information planning to carry out to meet the access mode of expection, and correspondingly carry out file access operations.
Step 104 specifically can comprise: sort to this predetermined file access operations that will carry out by physical location information, and to make in the process of carrying out the described predetermined file access operations that will carry out by this sequence, the displacement of magnetic head is the shortest.
In an example, above-mentioned multiple files comprise a.txt, b.txt and c.txt.Its memory location at storer as shown in Figure 2.In a program, according to normal sequence of operation, the reading order of these three files is a.txt, b.txt, c.txt.In the process, the operating path of magnetic head is as follows: first, and magnetic head moves to a.txt position from buffer zone, after completing a.txt reading, move to b.txt position, after completing b.txt reading, move to c.txt position again, as shown in path in Fig. 2 201.
According to step S104, if sort by physical storage locations to the file related to, then three above-mentioned file orderings are: a.txt, c.txt, b.txt.Carry out file access operations in this order, then magnetic head operating path is as follows: first, and magnetic head moves to a.txt position from buffer zone, after completing a.txt reading, move to c.txt position, after completing c.txt reading, move to b.txt position again, as shown in path in Fig. 2 202.
Contrast path 201 and path 202, in the access mode of the latter, the distance of magnetic head movement is minimum, both can reduce the time of access data, accelerates access speed, can reduce the wearing and tearing of magnetic head driving mechanism simultaneously.
Second embodiment
The structured flowchart of the data access arrangement that Fig. 3 provides for the second embodiment.As shown in Figure 3, this device comprises: data access interface 21, acquiring unit 22, interface interchange unit 23 and access unit 24.
Data access interface 21 is for obtaining at least one file physical storage locations information in memory.Data access interface 21 specifically can be used for: first, obtains the identifier (as filename) of the file that will inquire about; Then the storage information that above-mentioned metamessage data or file allocation table etc. obtain this file is inquired about; Physical storage locations information can be obtained according to this storage information.Be appreciated that above-mentioned data access interface can adopt any suitable programming language to realize.In one embodiment, above-mentioned data access interface realizes based on standard C language.In an example, above-mentioned data access interface, only supports the physical storage locations information of an inquiry file.In another example, above-mentioned data access interface, it can receive a listed files as parameter, and the physical storage locations information of All Files in corresponding backspace file list.
Acquiring unit 22 is for obtaining the identifier of multiple file.In an example, above-mentioned identifier is filename.Be appreciated that in above-mentioned filename and should comprise complete store path.In addition, above-mentioned identifier is not limited to filename, arbitrarily can support by file system, the data being used for inquiring about corresponding file all can be used as above-mentioned identifier.Such as, in an example, above-mentioned identifier is document number (call number).Above-mentioned multiple files are such as the files that will carry out accessing operation in a program in follow-up certain period.
Interface interchange unit 23, for calling this data access interface, obtains the physical storage locations information of these at least two files according to this identifier obtained.If data access interface 21 can only inquire about a file at every turn, then distinguish repeatedly calling data access interface 21, to obtain the physical storage locations information of each file in multiple file respectively.If data access interface 21 supports multifile inquiry, then can generate the list of the file that will inquire about, submit to this data access interface 21 as parameter by predetermined form, thus inquire about the physical storage locations information of the plurality of file simultaneously.
Access unit 24 this physical storage locations information for obtaining according to described acquiring unit, the predetermined file access operations that will carry out of planning to meet the access mode of expection, and correspondingly carries out file access operations.
Such as, sort to this predetermined file access operations that will carry out by physical location information, to make in the process of carrying out the described predetermined file access operations that will carry out by this sequence, the displacement of magnetic head is the shortest.
In an example, above-mentioned multiple files comprise a.txt, b.txt and c.txt.Its memory location at storer as shown in Figure 2.In a program, according to normal sequence of operation, the reading order of these three files is a.txt, b.txt, c.txt.In the process, the operating path of magnetic head is as follows: first, and magnetic head moves to a.txt position from buffer zone, after completing a.txt reading, move to b.txt position, after completing b.txt reading, move to c.txt position again, as shown in path in Fig. 2 201.
Because access unit 24 sorts by physical storage locations to the file related to, then three above-mentioned file orderings are: a.txt, c.txt, b.txt.Carry out file access operations in this order, then magnetic head operating path is as follows: first, and magnetic head moves to a.txt position from buffer zone, after completing a.txt reading, move to c.txt position, after completing c.txt reading, move to b.txt position again, as shown in path in Fig. 2 202.
Contrast path 201 and path 202, in the access mode of the latter, the distance of magnetic head movement is minimum, both can reduce the time of access data, accelerates access speed, can reduce the wearing and tearing of the wearing and tearing magnetic head driving mechanism of magnetic head simultaneously.
It should be noted that, in this article, the such as relational terms of first and second grades and so on is only used for an entity or operation to separate with another entity or operational zone, and not necessarily requires or imply the relation that there is any this reality between these entities or operation or sequentially.And, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thus make to comprise the process of a series of key element, method, article or device and not only comprise those key elements, but also comprise other key elements clearly do not listed, or also comprise by the intrinsic key element of this process, method, article or device.When not more restrictions, the key element limited by statement " comprising ... ", and be not precluded within process, method, article or the device comprising described key element and also there is other identical element.
One of ordinary skill in the art will appreciate that all or part of step realizing above-described embodiment can have been come by hardware, the hardware that also can carry out instruction relevant by program completes, described program can be stored in a kind of computer-readable recording medium, the above-mentioned storage medium mentioned can be ROM (read-only memory), disk or CD etc.
The above, it is only preferred embodiment of the present invention, not any pro forma restriction is done to the present invention, although the present invention discloses as above with preferred embodiment, but and be not used to limit the present invention, any those skilled in the art, do not departing within the scope of technical solution of the present invention, make a little change when the technology contents of above-mentioned announcement can be utilized or be modified to the Equivalent embodiments of equivalent variations, in every case be do not depart from technical solution of the present invention content, according to any simple modification that technical spirit of the present invention is done above embodiment, equivalent variations and modification, all still belong in the scope of technical solution of the present invention.
Claims (10)
1. a data access method, is characterized in that, comprising:
Load data access interface, this data access interface is for obtaining at least one file physical storage locations information in memory;
Obtain the identifier of at least two files;
Call this data access interface, make this data access interface obtain the physical storage locations information of these at least two files according to this identifier;
The file access operations making a reservation for according to this physical storage locations information planning to carry out to meet the access mode of expection, and correspondingly carries out file access operations.
2. method according to claim 1, is characterized in that, comprises with the access mode meeting expection according to the file access operations that this physical storage locations information planning makes a reservation for carry out:
Sort to this predetermined file access operations that will carry out by physical location information, to make in the process of carrying out the described predetermined file access operations that will carry out by this sequence, the displacement of magnetic head is the shortest.
3. method according to claim 1, is characterized in that, this identifier is filename.
4. method according to claim 1, is characterized in that, this data access interface is used for the document number obtaining the plurality of file according to this identifier, and then the off-set value of inquiring about the plurality of file according to this document number is to obtain this physical storage locations information.
5. method according to claim 1, is characterized in that, this storer is the storer realizing reading based on magnetic head.
6. a data access arrangement, is characterized in that, comprising:
Data access interface, for obtaining at least one file physical storage locations information in memory;
Acquiring unit, for obtaining the identifier of at least two files;
Interface interchange unit, for calling this data access interface, obtains the physical storage locations information of these at least two files according to this identifier obtained;
Access unit, for this physical storage locations information obtained according to described acquiring unit, the predetermined file access operations that will carry out of planning to meet the access mode of expection, and correspondingly carries out file access operations.
7. device according to claim 6, it is characterized in that, this access unit is used for: sort to this predetermined file access operations that will carry out by physical location information, and to make in the process of carrying out the described predetermined file access operations that will carry out by this sequence, the displacement of magnetic head is the shortest.
8. device according to claim 6, is characterized in that, this identifier is file path or document number.
9. device according to claim 6, is characterized in that, this data access interface is used for the document number obtaining the plurality of file according to this identifier, and then the off-set value of inquiring about the plurality of file according to this document number is to obtain this physical storage locations information.
10. device according to claim 6, is characterized in that, this storer is the storer realizing reading based on magnetic head.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310359608.9A CN104375781B (en) | 2013-08-16 | 2013-08-16 | Data access method and device |
PCT/CN2014/084187 WO2015021910A1 (en) | 2013-08-16 | 2014-08-12 | Method for accessing data and apparatus thereof |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310359608.9A CN104375781B (en) | 2013-08-16 | 2013-08-16 | Data access method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104375781A true CN104375781A (en) | 2015-02-25 |
CN104375781B CN104375781B (en) | 2019-07-23 |
Family
ID=52468057
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310359608.9A Active CN104375781B (en) | 2013-08-16 | 2013-08-16 | Data access method and device |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN104375781B (en) |
WO (1) | WO2015021910A1 (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2017045545A1 (en) * | 2015-09-14 | 2017-03-23 | 中兴通讯股份有限公司 | Method and apparatus for managing loads of multiple storage disks, file system, and storage network system |
CN107357929A (en) * | 2017-07-27 | 2017-11-17 | 广东欧珀移动通信有限公司 | File reading, mobile terminal and readable storage medium storing program for executing |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1567247A (en) * | 2003-07-10 | 2005-01-19 | 上海龙林通信技术有限公司 | Media file memory system and fetching mode thereof |
CN101048822A (en) * | 2004-10-26 | 2007-10-03 | 松下电器产业株式会社 | Disk reproducing apparatus |
CN101206554A (en) * | 2006-12-15 | 2008-06-25 | 株式会社东芝 | Hard disk drive and command execution method |
US20130091307A1 (en) * | 2011-10-06 | 2013-04-11 | Marvell World Trade Ltd. | Method and apparatus for effectively increasing a command queue length for accessing storage |
-
2013
- 2013-08-16 CN CN201310359608.9A patent/CN104375781B/en active Active
-
2014
- 2014-08-12 WO PCT/CN2014/084187 patent/WO2015021910A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1567247A (en) * | 2003-07-10 | 2005-01-19 | 上海龙林通信技术有限公司 | Media file memory system and fetching mode thereof |
CN101048822A (en) * | 2004-10-26 | 2007-10-03 | 松下电器产业株式会社 | Disk reproducing apparatus |
CN101206554A (en) * | 2006-12-15 | 2008-06-25 | 株式会社东芝 | Hard disk drive and command execution method |
US20130091307A1 (en) * | 2011-10-06 | 2013-04-11 | Marvell World Trade Ltd. | Method and apparatus for effectively increasing a command queue length for accessing storage |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2017045545A1 (en) * | 2015-09-14 | 2017-03-23 | 中兴通讯股份有限公司 | Method and apparatus for managing loads of multiple storage disks, file system, and storage network system |
CN107357929A (en) * | 2017-07-27 | 2017-11-17 | 广东欧珀移动通信有限公司 | File reading, mobile terminal and readable storage medium storing program for executing |
Also Published As
Publication number | Publication date |
---|---|
CN104375781B (en) | 2019-07-23 |
WO2015021910A1 (en) | 2015-02-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103020255B (en) | Classification storage means and device | |
KR102031588B1 (en) | Method and system for implementing index when saving file | |
CN109033360B (en) | Data query method, device, server and storage medium | |
KR20170123336A (en) | File manipulation method and apparatus | |
CN102779180A (en) | Operation processing method of data storage system and data storage system | |
US20120158453A1 (en) | Workflow processing system for supporting multi-tenant, and method thereof | |
CN103186622B (en) | The update method of index information and device in a kind of text retrieval system | |
CN103488687A (en) | Searching system and searching method of big data | |
CN107391544B (en) | Processing method, device and equipment of column type storage data and computer storage medium | |
CN109101516A (en) | A kind of data query method and server | |
CN108572789B (en) | Disk storage method and device, message pushing method and device and electronic equipment | |
CN102129425A (en) | Method and device for accessing large-object set table in data warehouse | |
US10423580B2 (en) | Storage and compression of an aggregation file | |
CN107704633A (en) | A kind of method and system of file migration | |
CN109213898A (en) | The video retrieval method and device of video monitoring system | |
CN104933051A (en) | File storage space recovery method and device | |
CN108475201A (en) | A kind of data capture method in virtual machine start-up course and cloud computing system | |
CN111831691B (en) | Data reading and writing method and device, electronic equipment and storage medium | |
CN102541952A (en) | Method and device for acquiring history data on basis of database | |
KR101512296B1 (en) | File associated with application processing terminal and processing method of file associated with application | |
KR101666440B1 (en) | Data processing method in In-memory Database System based on Circle-Queue | |
CN104375781A (en) | Data access method and device | |
CN105426131A (en) | KV (Key Value) storage implementation method and device | |
CN101833585A (en) | Database server operation control system, method and device | |
CN103995706A (en) | Method and device for displaying picture thumbnail |
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 |