CN105260139B - A kind of disk management method and system - Google Patents

A kind of disk management method and system Download PDF

Info

Publication number
CN105260139B
CN105260139B CN201510679878.7A CN201510679878A CN105260139B CN 105260139 B CN105260139 B CN 105260139B CN 201510679878 A CN201510679878 A CN 201510679878A CN 105260139 B CN105260139 B CN 105260139B
Authority
CN
China
Prior art keywords
data
disk
read
entries
written
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.)
Active
Application number
CN201510679878.7A
Other languages
Chinese (zh)
Other versions
CN105260139A (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.)
Rockchip Electronics Co Ltd
Original Assignee
Fuzhou Rockchip Electronics 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 Fuzhou Rockchip Electronics Co Ltd filed Critical Fuzhou Rockchip Electronics Co Ltd
Priority to CN201510679878.7A priority Critical patent/CN105260139B/en
Publication of CN105260139A publication Critical patent/CN105260139A/en
Application granted granted Critical
Publication of CN105260139B publication Critical patent/CN105260139B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

A kind of disk management method of present invention offer includes that data write process and data read procedure, and the data write process and data read procedure sequence in no particular order:The data write process:A storage region is opened up in memory, and the data to be written are written to storage region;The data read procedure is specially:When reading data according to disk address, storage region is first searched, if finding, data are directly read from storage region;Otherwise data are read from disk;The present invention also provides a kind of disk management systems, substantially increase the fluency of system.

Description

A kind of disk management method and system
Technical field
The present invention relates to a kind of disk management method and systems.
Background technology
There are some APK in Android at present, their Run-time scenario exists simultaneously the more behavior read and write, by grinding Study carefully discovery, substantially they read all there is consistent relevance with the file write, that is, the data write are exactly in their subsequent reads The data come.From platform, it is difficult to which the behavior to these APK constrains.So these APK some disk performances compared with It is run on the platform of difference, it is not smooth to may result in system.For the design of these APK, we devise one kind can for user The method of selection, the fluency of system when running these APK to improve.
Invention content
The technical problem to be solved in the present invention is to provide a kind of disk management method and system, improves system Fluency.
What one of the present invention program was realized in:A kind of disk management method, including data write process and data are read Process, the data write process and data read procedure sequence in no particular order:
The data write process:A storage region is opened up in memory, and the data to be written are written to and are deposited Storage area domain;
The data read procedure is specially:When reading data according to disk address, storage region is first searched, if finding, Data are then directly read from storage region;Otherwise data are read from disk.
Further, the data write process and are specially further:A storage region is opened up in memory, in storage region A data staging area is inside opened up, and creates data entries library;The data to be written are written to data staging area, and will Data information is recorded to data entries, and described information entry is stored into data entries library.
Further, described information entry includes:It is written including the initial address of disk, end address, data entity institute The position and read flag position deposited.
Further, the data read procedure is specially:When reading data according to disk address, it is total first to traverse storage region Data are directly read from storage region, and the read flag position in the data entries is marked if finding in data entries library To have read;Otherwise data are read from disk.
Further, further include a merging write-back process, periodically read data entries library, will read flag position be wherein to have read The corresponding data of data entries take out, and according to the initial address of the write-in disk in described information entry and end address It writes data into disk.
Further, the merging write-back process is specially further:Data entries libraries is periodically read, it will wherein read flag Position is taken out for the corresponding data of data entries read, if the end address in a data entries and rising in another data entries Beginning address is continuous, then merges the data corresponding to the two data entries, disk is written later, otherwise according to information Data are sequentially written in disk by the initial address of the write-in disk in entry and end address.
What the two of the present invention program were realized in:A kind of disk management system, including data writing module and data are read Module, the data writing module and data read through model in no particular order sequence:
The data to be written are written to storage by the data writing module for opening up a storage region in memory Region;
The data read through model first searches storage region when for reading data according to disk address, if finding, Data are directly read from storage region;Otherwise data are read from disk.
Further, the data writing module is specially further:A storage region is opened up in memory, in storage region A data staging area is inside opened up, and creates data entries library;The data to be written are written to data staging area, and will Data information is recorded to data entries, and described information entry is stored into data entries library.
Further, described information entry includes:It is written including the initial address of disk, end address, data entity institute The position and read flag position deposited.
Further, the data read through model is specially:When reading data according to disk address, it is total first to traverse storage region Data are directly read from storage region, and the read flag position in the data entries is marked if finding in data entries library To have read;Otherwise data are read from disk.
Further, further include one merging back into writing module, for periodically reading data entries library, be by wherein read flag position The corresponding data of data entries read are taken out, and according to the initial address of the write-in disk in described information entry and end Address writes data into disk.
Further, the writing module that merges back into is specially further:Data entries libraries is periodically read, it will wherein read flag Position is taken out for the corresponding data of data entries read, if the end address in a data entries and rising in another data entries Beginning address is continuous, then merges the data corresponding to the two data entries, disk is written later, otherwise according to information Data are sequentially written in disk by the initial address of the write-in disk in entry and end address.
The invention has the advantages that:A kind of disk management method of the present invention and system so that APK is unreasonable to use magnetic The behavior of disk is effectively evaded, and user experience is greatly improved..
Description of the drawings
The present invention is further illustrated in conjunction with the embodiments with reference to the accompanying drawings.
Fig. 1 is a kind of functional block diagram of disk management system of the present invention.
Fig. 2 is a kind of disk management method flow chart of the present invention.
Specific implementation mode
As shown in Fig. 2, inventive disk management method, including data write process and data read procedure, the data are write Process and data read procedure sequence in no particular order:
The data write process:A storage region is opened up in memory, and it is temporary that a data are opened up in storage region Region is deposited, and creates data entries library;The data to be written are written to data staging area, and by data information record to Data entries store described information entry into data entries library, and described information entry includes:The starting point of disk is written The position and read flag position of memory where location, end address, data entity;
The data read procedure is specially:When reading data according to disk address, storage region total information entry is first traversed Data are directly read from storage region, and the read flag position in the data entries is marked as read if finding in library; Otherwise data are read from disk.
Merge write-back process, periodically read data entries libraries, is that the data entries read are corresponding by wherein read flag position Data are taken out, if the end address in a data entries is continuous with the initial address in another data entries, by the two Data corresponding to data entries merge, and disk is written later, otherwise according to the starting of the write-in disk in data entries Data are sequentially written in disk by address and end address.
As shown in Figure 1, inventive disk manages system, including data writing module and data read through model, the data are write Module and data read through model sequence in no particular order:
The data writing module, opens up a storage region in memory, and a data staging area is opened up in storage region, And create data entries library;The data to be written are written to data staging area, and data information is recorded to information bar Mesh stores described information entry into data entries library, and described information entry includes:The initial address of disk is written, terminates The position and read flag position of memory where address, data entity.
The data read through model is specially:When reading data according to disk address, storage region total information entry is first traversed Data are directly read from storage region, and the read flag position in the data entries is marked as read if finding in library; Otherwise data are read from disk.
Writing module is merged back into, is the data entries pair read by wherein read flag position for periodically reading data entries library The data answered are taken out, if the end address in a data entries is continuous with the initial address in another data entries, by this Data corresponding to two data entries merge, and disk is written later, otherwise according to the write-in disk in data entries Data are sequentially written in disk by initial address and end address.
A kind of specific implementation mode of the present invention is as follows:
(1) when user brings into operation certain APK, system pop-up prompt, if the user desired that using designed by this case Mechanism then chooses confirmation on a user interface.
(2) the block device administrative unit of system opens up one piece of region in memory, and the letter of data is written for preserving the APK Breath record, we term it write-in data information units.
Which includes the information contents of each write-in disk of APK, include the initial address of write-in disk, end address And the position of memory where data entity, further include
One read flag position.
(3) when data are written to disk address A in the APK, the fast device management unit of system is distributed one piece of memory and is assumed For MA, data to be written is stored in the memory, then exists
It is written and creates a data entries in data information units, the initial position of entry is A, is A+ data until terminating Size, memory bits are then directed toward MA.
(4) when the APK reads data, owning in block administrative unit traversal write-in data information units to disk address B Entry can not find the record that address is B, then directly
It is submitted to disk drive, goes to read from disk.
(5) when the APK reads data, owning in block administrative unit traversal write-in data information units to disk address A Entry finds the record for having existed the data that Disk Locality is A,
Then from the entry of record, the core position pointed by memory bits obtains data entity, returns to APK.Together When, by the read flag position mark of A entries
For "read".
(6) merge all entries periodically traversed with write back unit in write-in data information units, read flag is flagged Write back data pointed by the data entries of "read",
The disk first place address of write-back and data entity can be obtained from data entries.In addition, if the number of write-back There is a situation where that disk first place address is continuous according to middle,
Write-back can then be merged, reduce I/O Request quantity.
Its advantage is as follows:
User enables this case the method, then system block device management unit no longer will directly be read and write caused by the APK Disk drive is sent in the request of disk.
Block device administrative unit opens up a block space, preserves the information of APK write-in data.The information includes write-in number According to the logical start address of place disk, logic end address, the memory where data and read flag.Wherein, where data Memory is directed toward the memory that data entity is stored;Read flag indicates whether that the data of the entry were read by APK.
When this APK has the data of write-in disk, block administrative unit can increase an item in write-in data record unit Mesh information, and memory is opened up to preserve data entity.If APK wishes to read data, block management from disk logical address A Unit first from write-in data record unit all entries in inquire whether have address be A data be recorded, if so, then from Memory information where data is taken out in the entry that recording address is A, data is fetched from the memory that the information is directed toward and returns to APK.Configure the read flag of the A entry information to "read" simultaneously.If being written in all entries of data record unit does not have It is A including address, then directly goes to read from disk.
(4) block device administrative unit also sets up a merging and write-back mechanism, periodically inquiry write-in data record unit All read flags are by read flag " read " entry corresponding to write back data to disk.Meanwhile also check for these will The logic beginning and end address of disk whether there is continuity where the data of write-back, if it is, continuous part is merged into one Secondary disk I/O Request reduces disk occupancy.
Although specific embodiments of the present invention have been described above, those familiar with the art should manage Solution, we are merely exemplary described specific embodiment, rather than for the restriction to the scope of the present invention, it is familiar with this The technical staff in field modification and variation equivalent made by the spirit according to the present invention, should all cover the present invention's In scope of the claimed protection.

Claims (2)

1. a kind of disk management method, it is characterised in that:Process and data read procedure are write including data, the data write process And data read procedure in no particular order sequence:
The data write process:A storage region is opened up in memory, and a data working area is opened up in storage region Domain, and create data entries library;The data to be written are written to data staging area, and data information is recorded to information Entry stores described information entry into data entries library, and described information entry includes:Initial address, the knot of disk is written The position and read flag position of memory where beam address, data entity;
The data read procedure is specially:When reading data according to disk address, storage region total information item library is first traversed, if It finds, then directly reads data from storage region, and the read flag position in the data entries is marked as read;Otherwise from Disk reads data;
Further include a merging write-back process, periodically reads data entries library, be the data entries pair read by wherein read flag position The data answered are taken out, if the end address in a data entries is continuous with the initial address in another data entries, by this Data corresponding to two data entries merge, and disk is written later, otherwise according to the write-in disk in data entries Data are sequentially written in disk by initial address and end address.
2. a kind of disk management system, it is characterised in that:Including data writing module and data read through model, the data writing module And data read through model in no particular order sequence:
The data writing module opens up a data staging area for opening up a storage region in memory in storage region, And create data entries library;The data to be written are written to data staging area, and data information is recorded to information bar Mesh stores described information entry into data entries library, and described information entry includes:The initial address of disk is written, terminates The position and read flag position of memory where address, data entity;
The data read through model when for reading data according to disk address, first traverses storage region total information item library, if looking into It finds, then directly reads data from storage region, and the read flag position in the data entries is marked as read;Otherwise from magnetic Disk reads data;
Further include one merging back into writing module, is the information bar read by wherein read flag position for periodically reading data entries library The corresponding data of mesh are taken out, if the initial address in the end address and another data entries in a data entries is continuous, Data corresponding to the two data entries are merged, disk is written later, otherwise according to the write-in magnetic in data entries Data are sequentially written in disk by the initial address of disk and end address.
CN201510679878.7A 2015-10-19 2015-10-19 A kind of disk management method and system Active CN105260139B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510679878.7A CN105260139B (en) 2015-10-19 2015-10-19 A kind of disk management method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510679878.7A CN105260139B (en) 2015-10-19 2015-10-19 A kind of disk management method and system

Publications (2)

Publication Number Publication Date
CN105260139A CN105260139A (en) 2016-01-20
CN105260139B true CN105260139B (en) 2018-09-28

Family

ID=55099846

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510679878.7A Active CN105260139B (en) 2015-10-19 2015-10-19 A kind of disk management method and system

Country Status (1)

Country Link
CN (1) CN105260139B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107145301B (en) * 2016-03-01 2020-09-01 深信服科技股份有限公司 Data access method and device based on hybrid disk
CN110032440A (en) * 2018-01-11 2019-07-19 武汉斗鱼网络科技有限公司 A kind of EMS memory management process and relevant apparatus
CN109558073A (en) * 2018-10-25 2019-04-02 深圳点猫科技有限公司 A kind of disk based on educational system extends the method and electronic equipment in service life
CN109634528A (en) * 2018-12-12 2019-04-16 浪潮(北京)电子信息产业有限公司 A kind of rule method, apparatus, equipment and the storage medium of target data
CN113064724A (en) * 2021-03-26 2021-07-02 华控清交信息科技(北京)有限公司 Memory allocation management method and device and memory allocation management device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1862476A (en) * 2006-04-19 2006-11-15 华中科技大学 Super large capacity virtual magnetic disk storage system
CN101477492A (en) * 2009-01-21 2009-07-08 华中科技大学 Circulating rewriting flash memory equalization method used for solid state disk

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6754800B2 (en) * 2001-11-14 2004-06-22 Sun Microsystems, Inc. Methods and apparatus for implementing host-based object storage schemes

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1862476A (en) * 2006-04-19 2006-11-15 华中科技大学 Super large capacity virtual magnetic disk storage system
CN101477492A (en) * 2009-01-21 2009-07-08 华中科技大学 Circulating rewriting flash memory equalization method used for solid state disk

Also Published As

Publication number Publication date
CN105260139A (en) 2016-01-20

Similar Documents

Publication Publication Date Title
CN105574104B (en) A kind of LogStructure storage system and its method for writing data based on ObjectStore
CN105260139B (en) A kind of disk management method and system
US9298384B2 (en) Method and device for storing data in a flash memory using address mapping for supporting various block sizes
CN104850358B (en) A kind of magneto-optic electricity mixing storage system and its data acquisition and storage method
CN106294229A (en) Read while in serial interface memory and write storage operation
CN107526743A (en) Method and apparatus for compressed file system metadata
CN102521349A (en) Pre-reading method of files
KR101374065B1 (en) Data Distinguish Method and Apparatus Using Algorithm for Chip-Level-Parallel Flash Memory
CN108431783A (en) Access request processing method, device and computer system
US9875030B2 (en) Media write operation
US10055162B2 (en) Using a tree-based data structure to map logical addresses to physical addresses on a storage device
US20160293207A1 (en) System and method of conducting in-place write operations in a shingled magnetic recording (smr) drive
KR20120102923A (en) Storage system for supporting copy and move command and operating method thereof
CN109902034A (en) Snapshot creation method, device, electronic equipment and machine readable storage medium
KR20110046118A (en) Adaptive logging apparatus and method
US20160070648A1 (en) Data storage system and operation method thereof
CN104461384B (en) A kind of method for writing data and storage device
CN108431784A (en) Access request processing method, device and computer system
SG126863A1 (en) Recording apparatus
KR20080098104A (en) Method of storing meta-data and system for storing meta-data
CN102650972B (en) Date storage method, Apparatus and system
CN107102900B (en) Management method of shared memory space
CN104281517A (en) Log mode based memory space management method and device
CN105653466A (en) Data storage device and flash memory control method
CN108776578B (en) Method and system for rapidly merging objects

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
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: 350000 building, No. 89, software Avenue, Gulou District, Fujian, Fuzhou 18, China

Patentee after: Ruixin Microelectronics Co., Ltd

Address before: 350000 building, No. 89, software Avenue, Gulou District, Fujian, Fuzhou 18, China

Patentee before: Fuzhou Rockchips Electronics Co.,Ltd.