CN108763479A - File management method based on terminal document system - Google Patents

File management method based on terminal document system Download PDF

Info

Publication number
CN108763479A
CN108763479A CN201810533837.0A CN201810533837A CN108763479A CN 108763479 A CN108763479 A CN 108763479A CN 201810533837 A CN201810533837 A CN 201810533837A CN 108763479 A CN108763479 A CN 108763479A
Authority
CN
China
Prior art keywords
data
piece
terminal
file
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.)
Pending
Application number
CN201810533837.0A
Other languages
Chinese (zh)
Inventor
王珂
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ningbo Sanxing Medical and Electric Co Ltd
Original Assignee
Ningbo Sanxing Medical and Electric 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 Ningbo Sanxing Medical and Electric Co Ltd filed Critical Ningbo Sanxing Medical and Electric Co Ltd
Priority to CN201810533837.0A priority Critical patent/CN108763479A/en
Publication of CN108763479A publication Critical patent/CN108763479A/en
Pending legal-status Critical Current

Links

Abstract

The present invention relates to the file management methods based on terminal document system, by creating original document piece in terminal document system, terminal is according to the writing ranges of data to be written and original document piece amount of capacity multilevel iudge, with when the writing range of data to be written exceeds original document piece, it is written into the preceding segment data write-in original document piece of data, the rear segment data for being written into data is written in system in stored files for storage piece, it realizes in the case where not changing original document piece capacity, writing range according to data to be written is automatic, dynamic adjustment terminal document system is interior and matches the file piece quantity of data writing range to be written, promote the space availability ratio of terminal document system;When data in reading terminals file system, terminal automatically switches the data of each file piece in reading terminals file system according to the read range of data to be read with the amount of capacity of original document piece, realizes automatic switchover read operation of the terminal document system to data to be read.

Description

File management method based on terminal document system
Technical field
The present invention relates to terminal document management domain more particularly to a kind of file management sides based on terminal document system Method.
Background technology
Due to the limited system resources of common terminal platform, terminal system file system function mounted is simultaneously not perfect, Cause file when changing capacity, deletion or renaming, it is necessary to assure the powered stable that terminal is received is reliable;Otherwise, terminal File in file system, which will exist, to be risk of damage to.
For above-mentioned risk, following method is primarily now taken to cope with the risk:Text is created in terminal document system When part, then the possible maximum capacity of calculation document first removes the file for creating content blank according to the maximum capacity, finally exists The write-in for data in file and read operation are completed in the case of not changing file size.
But there is also shortcomings for the above method:First, file is once created in terminal document system and will be occupied The fixed space of system causes the space availability ratio of terminal document system relatively low;Secondly, the text created in terminal document system Part generally selects as possible without delete operation, but does not largely delete file (or discarded file) by occupied terminal file The space of system can equally reduce the space availability ratio of terminal document system.
Invention content
It is a kind of based on terminal document system the technical problem to be solved by the present invention is to provide for the above-mentioned prior art File management method.
Technical solution is used by the present invention solves above-mentioned technical problem:File management side based on terminal document system Method, which is characterized in that include the following steps 1 to step 5:
Step 1, when the terminal needs to create the file of record data, matching is created in the terminal document system The original document piece of this document purposes;
Step 2, when the terminal carries out write-in data manipulation, the writing range of data to be written is obtained;Wherein, described to wait for The writing range of data is written as writing position value of the data to be written in terminal document system to the writing position value With the section of the sum of data length to be written;
Step 3, according to the capacity of the original document piece and the writing range of the data to be written, judge to be directed to institute State the further operating of data to be written:
Step 3-1, when capacity of the writing range of the data to be written without departing from the original document piece, then by institute Data to be written are stated to be written in the original document piece;
Step 3-2, when the writing range of the data to be written exceeds the capacity of the original document piece, and the terminal There are when next file piece in file system:
When next file piece capacity can accommodate the rear segment data of data to be written, then by the data to be written Preceding segment data is written at said write positional value in original document piece, and the rear segment data of the data to be written is written to Next file piece present in terminal document system;Otherwise, terminal automatically creates required amount of in its file system And with the backup file piece of the capacity such as next file piece, by the front end data of the data to be written in said write position Be written at value in original document piece, the Back end data of the data to be written is sequentially written in automatically create it is described each spare In file piece;Wherein, the preceding segment data is in data to be written in said write position and original document piece end Data between position, the rear segment data are to remove the data after the preceding segment data in data to be written;The spare text The quantity of part piece the upward of quotient between the back segment data length and next file piece capacity of the data to be written takes Whole value;
Step 3-3, when the writing range of the data to be written exceeds the capacity of the original document piece, and the terminal When next file piece being not present in file system, the terminal automatically creates requirement in its system and holds with default The new file piece of amount, and the preceding segment data of the data to be written is written to the original document at said write positional value In piece, the rear segment data of the data to be written is sequentially written in each new file piece automatically created;Wherein, described The quantity of new file piece the upward of quotient between the back segment data length and the new file piece capacity of the data to be written takes Whole value;
Step 4, when the terminal is read out data manipulation, the read range of data to be read is obtained;Wherein, described to wait for The read range of data is read as reading position value of the data to be read in terminal document system to the reading position value With the section of the sum of data length to be read;
Step 5, according to the capacity of the original document piece and the read range of the data to be read, judge to be directed to institute State the further operating of data to be read:
Step 5-1, when capacity of the read range of the data to be read without departing from the original document piece, then in institute State the data read at reading position value in the original document piece;
Step 5-2, when the read range of the data to be read exceeds the capacity of the original document piece, and the terminal There are when the files for storage piece of at least one storage data in file system, the terminal is read in the original document piece Data as the preceding segment data of the data to be read, the data that are successively read in each files for storage piece be used as described in continue The rear segment data for evidence of fetching;
Step 5-3, when the read range of the data to be read exceeds the capacity of the original document piece, and the terminal There is no when the files for storage piece of storage data in file system, the terminal reads described first at the reading position Preceding segment data of the data as the data to be read in beginning file piece, and access of continuing described in empty data conduct is read automatically According to rear segment data.
With improvement, described based in the file management method of terminal document system, the terminal needs to reduce file appearance When amount, the terminal obtains the end position of the file to be reduced, and it is later by the terminal to remove the end of file position Data.
Further, after the end of file position of the capacity to be reduced there are when extra file piece, the end Automatically the extra file piece is recycled in end.
With improvement, described based in the file management method of terminal document system, the text in the terminal document system Part title includes the serial number of the file name that this document piece is belonged to and this document piece in its belonged to file.
It improves again, the file management method based on terminal document system further includes:The terminal executes delete target When Object Operations, terminal sets the target object to be deleted to the step of object to be deleted is stored;Wherein, described Target object is file piece or includes the file of file piece.
Further, described based in the file management method of terminal document system, the terminal is by by the mesh The header respective flag of mark object does set processing, and the target object is set to object to be deleted to realize.
It improves again, described based in the file management method of terminal document system, the terminal will wait for described in storage Object is deleted in preset time complete deletion.
Preferably, described based in the file management method of terminal document system, the preset time is the terminal Receive the time of stable power-supplying.
Compared with the prior art, the advantages of the present invention are as follows:
First, after the file management method in the present invention in terminal document system by creating original document piece, by end Multilevel iudge is made in end according to the writing range of data be written and the amount of capacity of original document piece, in data to be written When writing range exceeds original document piece, it is written into the preceding segment data write-in original document piece of data, and is written into data Rear segment data be written at least one files for storage piece stored in system, realize and do not changing original document In the case of piece capacity, according to the writing range of data to be written come it is automatic, dynamically adjust in terminal document system and match The file piece quantity of data writing range to be written, realization automatically provide appropriate number of according to the writing range of data to be written File piece accommodates current data to be written with lucky matching, promotes the space availability ratio of terminal document system;
Similarly, when data of the file management method in reading terminals file system in the present invention, also by terminal root Automatically switch each file in reading terminals file system according to the read range of data to be read and the amount of capacity of original document piece Automatic switchover read operation of the terminal document system to data to be read may be implemented in the data of piece in this way;Pass through what will be read After preceding segment data and rear segment data (if any) split, you can formation obtains the entire data to be read to be read;
Secondly, the file management method in the present invention waits deleting in the case where allowing file to delete also directed in system Except object thoroughly concentrates deletion in preset time, to reduce the risk that each file piece is accidentally deleted in file system, and then also improve The space availability ratio of terminal document system.
Description of the drawings
Fig. 1 is the file management method flow diagram based on terminal document system in the embodiment of the present invention.
Specific implementation mode
Below in conjunction with attached drawing embodiment, present invention is further described in detail.
As shown in Figure 1, the file management method based on terminal document system in the present embodiment, includes the following steps 1 to step Rapid 5:
Step 1, when terminal needs to create the file of record data, matching current file is created in terminal document system The original document piece of purposes;The amount of capacity of the original document piece is related with the current purposes of this file piece, for example, can root It is set as 1M according to the capacity by this original document piece is needed;
Step 2, when terminal carries out write-in data manipulation, the writing range of data to be written is obtained;Wherein, data to be written Writing range be writing position value of the data to be written in terminal document system to the writing position value and data to be written The section of the sum of length;
Step 3, according to the capacity of original document piece and the writing range of data to be written, judge to be directed to data to be written Further operating:
Step 3-1 shows current initial when capacity of the writing range of data to be written without departing from original document piece File piece capacity is enough to store entire data to be written, then is written into data and is written in original document piece;
Step 3-2, when the writing range of data to be written exceeds the capacity of original document piece, and terminal document Installed System Memory In next file piece, show that current original document capacity is difficult to store entire data to be written completely:
When next file piece capacity can accommodate the rear segment data of data to be written, then by the data to be written Preceding segment data is written at writing position value in original document piece, and the rear segment data of the data to be written is written to terminal Next file piece present in file system;Otherwise, terminal automatically created in its file system it is required amount of and with The front end data of the data to be written is written the backup file piece of the capacity such as next file piece at writing position value In to original document piece, the Back end data of the data to be written is sequentially written in each backup file piece automatically created;Its In, preceding segment data is in data to be written in the data between writing position and original document piece end position, rear segment data For the data for removing after preceding segment data in data to be written;The quantity of backup file piece is the back segment data length of data to be written The value that rounds up of quotient between next file piece capacity;It should be noted that preceding segment data herein and rear hop count After (if any) split, that is, form entire data to be written described in the present embodiment;
Step 3-3, when capacity of the writing range beyond original document piece of data to be written, and in terminal document system not There are when next file piece, which automatically creates requirement and the new file piece with preset capacity in its system, And the preceding segment data for being written into data is written at writing position value in original document piece, is written into the rear hop count of data According to being sequentially written in each new file piece automatically created;Wherein, the quantity of new file piece is the rear segment data of data to be written The value that rounds up of quotient between length and the new file piece capacity;
Step 4, when terminal is read out data manipulation, the read range of data to be read is obtained;Wherein, data to be read Read range be reading position value of the data to be read in terminal document system to the reading position value and data to be read The section of the sum of length;
Step 5, according to the capacity of original document piece and the read range of data to be read, judge to be directed to data to be read Further operating:
Step 5-1 shows continuing at this time when capacity of the read range of data to be read without departing from original document piece Access then reads the data in original document piece according to being located only in original document piece at reading position value;
Step 5-2, when the read range of data to be read exceeds the capacity of original document piece, and terminal document Installed System Memory In the files for storage piece of at least one storage data, terminal reads the data in original document piece as data to be read Rear segment data as data to be read of preceding segment data, the data that are successively read in each files for storage piece;Wherein, herein After preceding segment data and rear segment data (if any) split, that is, form entire data to be read described in the present embodiment;
Step 5-3, when capacity of the read range beyond original document piece of data to be read, and in terminal document system not When in the presence of the files for storage piece for storing data, terminal reads the data conduct in original document piece at reading position and continues The preceding segment data for evidence of fetching, and rear segment data of the empty data as data to be read is read automatically.Wherein, preceding segment data herein After rear segment data (if any) split, that is, form entire data to be read described in the present embodiment.
Certainly, in the present embodiment, when terminal needs to reduce file size, terminal obtains the end of the file to be reduced Position, and the later data in end of file position are removed by the terminal.Wherein, specifically, when the end of file of capacity to be reduced There are when extra file piece after position, terminal just recycles extra file piece automatically.
In addition, the file title in terminal document system includes the file name and this document piece that this document piece is belonged to Serial number in its belonged to file.For example, a file piece in terminal document system belongs to file A, this document piece exists Serial number 02 in its belonged to file A, then this file title in terminal document system is exactly A_02.Certainly, as text The definition format of part piece title can be set as needed, such as file piece name format can be set as " A_02 ", also may be used To be set as " A02 ".
When terminal needs execution deletion such as file piece or file these target objects operation including file piece, eventually End sets target object to be deleted to object to be deleted and stores;Wherein, target object mentioned here is file piece Or include the file of file piece.It is stored by setting target object to be deleted to object to be deleted, text at this time Either file piece can't be deleted immediately but the file being related to or file piece are set to file to be deleted or wait deleting part Except file.These files to be deleted or file piece to be deleted are not present for users at this time, but thus can be with Facilitate user by calling terminal document system to go to restore to obtain these files or file piece again.Certainly, in the present embodiment, The target object is set as to be deleted right by terminal by the way that the header respective flag of target object is done set processing, to realize As.
In order to save the space in terminal document system, the excessive occupied terminal file of file or file piece to be deleted system is avoided System space, and then the space availability ratio of terminal document system is improved, in the present embodiment, terminal exists the object to be deleted of storage Preset time complete deletion.Described preset time is the time that terminal receives stable power-supplying in the present embodiment.Certainly, this is pre- If the time, which can also be user oneself, defines setting, such as, the preset time of delete target object is daily 0:00.
Although the preferred embodiment of the present invention described in detail above, it is to be clearly understood that for this field Technical staff for, the invention may be variously modified and varied.Appoint made by all within the spirits and principles of the present invention What modification, equivalent replacement, improvement etc., should all be included in the protection scope of the present invention.

Claims (8)

1. the file management method based on terminal document system, which is characterized in that include the following steps 1 to step 5:
Step 1, when the terminal needs to create the file of record data, matching this article is created in the terminal document system The original document piece of part purposes;
Step 2, when the terminal carries out write-in data manipulation, the writing range of data to be written is obtained;Wherein, described to be written The writing range of data be writing position value of the data to be written in terminal document system to the writing position value with wait for The section of the sum of data length is written;
Step 3, according to the capacity of the original document piece and the writing range of the data to be written, judge to wait for for described The further operating of data is written:
Step 3-1 is then waited for described when capacity of the writing range of the data to be written without departing from the original document piece Write-in data are written in the original document piece;
Step 3-2, when the writing range of the data to be written exceeds the capacity of the original document piece, and the terminal document Installed System Memory is in next file piece:
When next file piece capacity can accommodate the rear segment data of data to be written, then by the leading portion of the data to be written Data are written at said write positional value in original document piece, and the rear segment data of the data to be written is written to terminal Next file piece present in file system;Otherwise, terminal automatically created in its file system it is required amount of and with The backup file piece of the capacity such as next file piece, by the front end data of the data to be written at said write positional value It is written in original document piece, the Back end data of the data to be written is sequentially written in each backup file automatically created In piece;Wherein, the preceding segment data is in data to be written in said write position and the original document piece end position Between data, it is described after segment data be data to be written in remove the data after the preceding segment data;The backup file piece Quantity be the data to be written back segment data length and next file piece capacity between quotient the value that rounds up;
Step 3-3, when the writing range of the data to be written exceeds the capacity of the original document piece, and the terminal document When next file piece being not present in system, the terminal automatically creates requirement in its system and has preset capacity New file piece, and the preceding segment data of the data to be written is written to the original document piece at said write positional value It is interior, the rear segment data of the data to be written is sequentially written in each new file piece automatically created;Wherein, described new The quantity of file piece be the data to be written back segment data length and the new file piece capacity between quotient round up Value;
Step 4, when the terminal is read out data manipulation, the read range of data to be read is obtained;Wherein, described to be read The read range of data be reading position value of the data to be read in terminal document system to the reading position value with wait for Read the section of the sum of data length;
Step 5, according to the capacity of the original document piece and the read range of the data to be read, judge to wait for for described Read the further operating of data:
Step 5-1, when capacity of the read range of the data to be read without departing from the original document piece, then in the reading Take the data read at positional value in the original document piece;
Step 5-2, when the read range of the data to be read exceeds the capacity of the original document piece, and the terminal document For Installed System Memory in the files for storage piece of at least one storage data, the terminal reads the number in the original document piece According to the preceding segment data as the data to be read, the data that are successively read in each files for storage piece be used as described in continue access According to rear segment data;
Step 5-3, when the read range of the data to be read exceeds the capacity of the original document piece, and the terminal document There is no when the files for storage piece of storage data in system, the terminal reads the initial text at the reading position Preceding segment data of the data as the data to be read in part piece, and empty data are read automatically as the data to be read Segment data afterwards.
2. the file management method according to claim 1 based on terminal document system, which is characterized in that the terminal needs When reducing file size, the terminal obtains the end position of the file to be reduced, and removes the end of file by the terminal The later data in position.
3. the file management method according to claim 2 based on terminal document system, which is characterized in that when described to be reduced There are when extra file piece after the end of file position of capacity, the terminal recycles the extra file piece automatically.
4. the file management method according to claim 1 based on terminal document system, which is characterized in that the terminal document File title in system includes the sequence of the file name that this document piece is belonged to and this document piece in its belonged to file Number.
5. the file management method according to claim 1 based on terminal document system, which is characterized in that further include:It is described When terminal executes delete target Object Operations, terminal sets the target object to be deleted to object to be deleted and stores The step of;Wherein, the target object is file piece or includes the file of file piece.
6. the file management method according to claim 5 based on terminal document system, which is characterized in that the terminal passes through The header respective flag of the target object is done into set processing, the target object is set to object to be deleted to realize.
7. the file management method according to claim 5 based on terminal document system, which is characterized in that the terminal will deposit The object to be deleted of storage is in preset time complete deletion.
8. the file management method according to claim 7 based on terminal document system, which is characterized in that the preset time Receive the time of stable power-supplying for the terminal.
CN201810533837.0A 2018-05-29 2018-05-29 File management method based on terminal document system Pending CN108763479A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810533837.0A CN108763479A (en) 2018-05-29 2018-05-29 File management method based on terminal document system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810533837.0A CN108763479A (en) 2018-05-29 2018-05-29 File management method based on terminal document system

Publications (1)

Publication Number Publication Date
CN108763479A true CN108763479A (en) 2018-11-06

Family

ID=64003930

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810533837.0A Pending CN108763479A (en) 2018-05-29 2018-05-29 File management method based on terminal document system

Country Status (1)

Country Link
CN (1) CN108763479A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113568767A (en) * 2021-06-30 2021-10-29 宁波三星医疗电气股份有限公司 Data writing file verification method suitable for intelligent power consumption terminal
CN115421649A (en) * 2022-08-02 2022-12-02 佳源科技股份有限公司 Indexable and extensible parameter file fragment storage system and method

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102136289A (en) * 2010-12-30 2011-07-27 华为技术有限公司 Methods, devices and systems for storing and reading media contents
US8239621B2 (en) * 2007-02-20 2012-08-07 Nec Corporation Distributed data storage system, data distribution method, and apparatus and program to be used for the same
CN103136338A (en) * 2013-02-04 2013-06-05 中国科学院信息工程研究所 Metadata distribution method and device based on directory partition
CN103825945A (en) * 2014-02-25 2014-05-28 华为技术有限公司 Fragmentation storage method and user terminal
US9043616B2 (en) * 2009-11-25 2015-05-26 Cleversafe, Inc. Efficient storage of encrypted data in a dispersed storage network
CN107391639A (en) * 2017-07-11 2017-11-24 惠州Tcl移动通信有限公司 A kind of automatic method, mobile terminal and storage device for recovering recycle bin file
CN107633059A (en) * 2017-09-20 2018-01-26 郑州云海信息技术有限公司 A kind of data processing method and system for distributed file system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8239621B2 (en) * 2007-02-20 2012-08-07 Nec Corporation Distributed data storage system, data distribution method, and apparatus and program to be used for the same
US9043616B2 (en) * 2009-11-25 2015-05-26 Cleversafe, Inc. Efficient storage of encrypted data in a dispersed storage network
CN102136289A (en) * 2010-12-30 2011-07-27 华为技术有限公司 Methods, devices and systems for storing and reading media contents
CN103136338A (en) * 2013-02-04 2013-06-05 中国科学院信息工程研究所 Metadata distribution method and device based on directory partition
CN103825945A (en) * 2014-02-25 2014-05-28 华为技术有限公司 Fragmentation storage method and user terminal
CN107391639A (en) * 2017-07-11 2017-11-24 惠州Tcl移动通信有限公司 A kind of automatic method, mobile terminal and storage device for recovering recycle bin file
CN107633059A (en) * 2017-09-20 2018-01-26 郑州云海信息技术有限公司 A kind of data processing method and system for distributed file system

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113568767A (en) * 2021-06-30 2021-10-29 宁波三星医疗电气股份有限公司 Data writing file verification method suitable for intelligent power consumption terminal
CN115421649A (en) * 2022-08-02 2022-12-02 佳源科技股份有限公司 Indexable and extensible parameter file fragment storage system and method
CN115421649B (en) * 2022-08-02 2023-10-20 佳源科技股份有限公司 Indexable and extensible parameter file slicing storage system and method

Similar Documents

Publication Publication Date Title
CN104462141B (en) Method, system and the storage engines device of a kind of data storage and inquiry
CN107506447A (en) A kind of small documents reading/writing method and system based on local file system
US20150082294A1 (en) Method and Apparatus for Generating Firmware Over the Air Upgrade Package
CN104699416B (en) A kind of data-storage system and a kind of date storage method
CN110147204B (en) Metadata disk-dropping method, device and system and computer-readable storage medium
CN101426052A (en) Backup and importing method for address book and short message of mobile terminal
JP3161520B2 (en) Portable terminal device and its character data storage method
CN108763479A (en) File management method based on terminal document system
CN109726177A (en) A kind of mass file subregion indexing means based on HBase
CN110673800B (en) Data operation method, device and equipment of file system and readable storage medium
JP2001175681A (en) Database system, method for generating replica of database, and computer-readable recording medium with recorded program for replica generation of database
CN102122284B (en) Compound document storage and read-write method and compound document storage and read-write device
WO2006021841A2 (en) Efficient synchronisation of smart card data with data stored on an external server
CN103957308A (en) Mobile terminal and contact person management method and device
CN101304454B (en) Method for rapidly inspecting short message history record
CN103092768A (en) Method and device of data processing in application system
CN107329695A (en) A kind of distributed storage EMS memory management process, system and computer-readable storage medium
US6973472B2 (en) Data synchronization system and method based on modification records and common formatting
CN101883168A (en) Method for efficiently managing cache files at mobile phone client
CN108228624A (en) Data acquisition and update method, piece list service system and piece single system
CN106959819A (en) Date storage method, device and system and portable electric appts
CN103200301B (en) A kind of information saving method based on note and mobile terminal
CN102708107A (en) Method and system for storing appended files
CN107145501A (en) File updating method, file copying method and corresponding system
CN1322707C (en) Call ticket repetition removing method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination