CN109213444A - File memory method and device, storage medium, terminal - Google Patents

File memory method and device, storage medium, terminal Download PDF

Info

Publication number
CN109213444A
CN109213444A CN201810940755.8A CN201810940755A CN109213444A CN 109213444 A CN109213444 A CN 109213444A CN 201810940755 A CN201810940755 A CN 201810940755A CN 109213444 A CN109213444 A CN 109213444A
Authority
CN
China
Prior art keywords
file
stored
record
storage
database
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
CN201810940755.8A
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.)
Shanghai Xiaoyi Technology Co Ltd
Original Assignee
Shanghai Xiaoyi Technology 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 Shanghai Xiaoyi Technology Co Ltd filed Critical Shanghai Xiaoyi Technology Co Ltd
Priority to CN201810940755.8A priority Critical patent/CN109213444A/en
Publication of CN109213444A publication Critical patent/CN109213444A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0674Disk device
    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07CTIME OR ATTENDANCE REGISTERS; REGISTERING OR INDICATING THE WORKING OF MACHINES; GENERATING RANDOM NUMBERS; VOTING OR LOTTERY APPARATUS; ARRANGEMENTS, SYSTEMS OR APPARATUS FOR CHECKING NOT PROVIDED FOR ELSEWHERE
    • G07C5/00Registering or indicating the working of vehicles
    • G07C5/08Registering or indicating performance data other than driving, working, idle, or waiting time, with or without registering driving, working, idle or waiting time
    • G07C5/0841Registering performance data
    • G07C5/085Registering performance data using electronic data carriers
    • G07C5/0866Registering performance data using electronic data carriers the electronic data carrier being a digital video recorder in combination with video camera

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • General Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A kind of file memory method and device, storage medium, terminal, file memory method includes: the attribute information for obtaining file to be stored, using the record as the file to be stored;Determine the remaining storage quantity of the corresponding database of the file to be stored;If the residue storage quantity is non-zero, the record of the file to be stored is stored in the database, and the file to be stored is stored to disk, the file in the disk and at least one database have mapping relations.Technical solution of the present invention can promote the memory space utilization efficiency of disk, promote the convenience of document retrieval.

Description

File memory method and device, storage medium, terminal
Technical field
The present invention relates to technical field of data processing more particularly to a kind of file memory method and device, storage medium, ends End.
Background technique
In Internet of Things, in specific such as car networking, intelligent back vision mirror or automobile data recorder, frequent progress circulation recording Afterwards, short-sighted frequency of largely recording a video can be produced.
In the prior art, a large amount of file is usually to be stored directly in disk.
But existing document storage mode causes the retrieval of file inconvenient, and the memory space utilization efficiency of disk It is low.
Summary of the invention
Present invention solves the technical problem that being how to promote the memory space utilization efficiency of disk, document retrieval is promoted just Victory.
In order to solve the above technical problems, the embodiment of the present invention provides a kind of file memory method, file memory method includes: The attribute information for obtaining file to be stored, using the record as the file to be stored;Determine that the file to be stored is corresponding The remaining storage quantity of database;If the residue storage quantity is non-zero, the record of the file to be stored is stored in The database, and the file to be stored is stored to disk, the file in the disk has at least one database Mapping relations.
Optionally, the file memory method further include: if the residue storage quantity is zero, delete the data Having stored record and having deleted described stored in library records pointed storage file, and the storage file is stored in In the disk.
Optionally, described to have stored the storage time that record includes the storage file;It is described to delete the database In to have stored record and deleted the pointed storage file of record that stored include: according at least to the database In the storage times of all records determine and described stored record;It deletes described stored and has stored note described in record and deletion The pointed storage file of record.
Optionally, the record that stored includes the locking initial time of storage file and locking duration;It is described Record is stored described in storage time determination according at least to all records in the database to comprise determining that in the database Storage time it is earliest be recorded as described stored record;Alternatively, if in the database at the earliest record of storage time In lock state, it is determined that storage time was earliest in the record in unlocked state be recorded as it is described stored record, note Record, which is in the lock state, refers to that current time is in time model defined by the locking initial time and locking duration of the record In enclosing.
Optionally, the record that stored includes the locking initial time of storage file and locking duration;It is described Include: if deleting having stored record and having deleted the record pointed storage file that stored in the database All records are in lock state in the database, then send status request to server, so that the server responds It is determined in the status request and deletes instruction, record is in the lock state the locking starting for referring to that current time is in the record In time range defined by time and locking duration;Deletion in response to the server instructs determination is described to store note Record, and delete described stored and stored the pointed storage file of record described in record and deletion.
Optionally, the remaining storage quantity of the corresponding database of the determination file to be stored includes: according to The source of file to be stored determines the corresponding database of the file to be stored;Determine the remaining storage quantity of the database.
Optionally, the attribute information of the file to be stored include file size, file type, message digest value and/or The identification information of associated record.
In order to solve the above technical problems, the embodiment of the invention also discloses a kind of file storage device, file storage device It include: record determining module, suitable for obtaining the attribute information of file to be stored, using the record as the file to be stored;It is surplus Remaining storage quantity determining module is adapted to determine that the remaining storage quantity of the corresponding database of the file to be stored;First storage Module is suitable for the record of the file to be stored being stored in the database, and will when the remaining storage quantity is non-zero The file to be stored is stored to disk, and the file in the disk and at least one database have mapping relations.
Optionally, the file storage device further include: the second memory module, suitable for being zero in the remaining storage quantity When, it deletes having stored record and having deleted described stored in the database and records pointed storage file, it is described Storage file is stored in the disk.
Optionally, described to have stored the storage time that record includes the storage file;The second memory module packet It includes: having stored record determination unit, determine described deposited suitable for the storage time according at least to all records in the database Storage record;First deletes unit, has deposited pointed by record suitable for having stored record described in deletion and having deleted described stored Store up file.
Optionally, the record that stored includes the locking initial time of storage file and locking duration;It is described Having stored record determination unit includes: the first determining subelement, is adapted to determine that the record that storage time is earliest in the database Record has been stored to be described;Second determines that subelement, the record earliest suitable for storage time in the database are in locking When state, determine storage time in the record in unlocked state it is earliest be recorded as it is described stored record, record is in Lock state refers to that current time is in time range defined by the locking initial time and locking duration of the record.
Optionally, the record that stored includes the locking initial time of storage file and locking duration;It is described Second memory module includes: status request transmission unit, suitable in the database it is all record be in lock state when, Status request is sent to server, so that the server is determined in response to the status request deletes instruction, record is in lock Determine state and refers to that current time is in time range defined by the locking initial time and locking duration of the record;Second Delete unit, be adapted for the server deletion instruction determine it is described stored record, and stored note described in deleting Record and described stored of deletion record pointed storage file.
Optionally, the remaining storage quantity determining module includes: database determination unit, described wait store suitable for basis The source of file determines the corresponding database of the file to be stored;Remaining storage quantity determination unit, is adapted to determine that the number According to the remaining storage quantity in library.
Optionally, the attribute information of the file to be stored include file size, file type, message digest value and/or The identification information of associated record.
The embodiment of the invention also discloses a kind of storage mediums, are stored thereon with computer instruction, the computer instruction The step of file memory method is executed when operation.
The embodiment of the invention also discloses a kind of terminal, including memory and processor, being stored on the memory can The computer instruction run on the processor, the processor execute the file storage when running the computer instruction The step of method.
Compared with prior art, the technical solution of the embodiment of the present invention has the advantages that
Technical solution of the present invention obtains the attribute information of file to be stored, using the record as the file to be stored;Really Determine the remaining storage quantity of the corresponding database of the file to be stored;If the residue storage quantity is non-zero, by institute The record for stating file to be stored is stored in the database, and the file to be stored is stored to disk, the text in the disk Part and at least one database have mapping relations.Technical solution of the present invention, will be wait deposit when storing to file to be stored The attribute information of storage file is stored to database, and file to be stored is stored disk partition corresponding to database, realizes magnetic The data base system of disk storage, it is convenient to the retrieval of disk stored file to may be implemented by the corresponding database of file in disk Property;In addition, same disk is by corresponding multiple databases, so as to according to the storage quantity of multiple databases in memory space On disk is divided into multiple disk partition, each disk partition can be managed independently and be stored, and disk storage space is improved Utilization efficiency.
Further, if it is described residue storage quantity be zero, delete in the database storage record and It deletes described stored and records pointed storage file, the storage file is stored in the disk.Skill of the present invention In art scheme, in the case where database has been expired, it can be realized by deleting existing record to current file to be stored Storage, realize file storage validity.
Further, it is determined that in the database storage time it is earliest be recorded as described stored record;Alternatively, if The earliest record of storage time is in the lock state in the database, it is determined that when storing in the record in unlocked state Between it is earliest be recorded as it is described stored record, record is in the lock state the locking for referring to that current time is in the record Begin in time range defined by time and locking duration.It, can be in the case where database has been expired in technical solution of the present invention The earliest record of storage time is deleted, to realize the storage to current file to be stored, realizes database and its corresponding Disk partition timely updates.In addition, the file of the record and its direction cannot be deleted for the record being in the lock state It removes, such as can be file of high importance, and then realize the flexibility that file storage updates.
Detailed description of the invention
Fig. 1 is a kind of flow chart of file memory method of the embodiment of the present invention;
Fig. 2 is a kind of specific embodiment flow chart of the file memory method of the embodiment of the present invention;
Fig. 3 is a kind of structural schematic diagram of file storage device of the embodiment of the present invention.
Specific embodiment
As described in the background art, existing document storage mode causes the retrieval of file inconvenient, and the storage of disk Space efficiency utilization is low.
Technical solution of the present invention stores the attribute information of file to be stored to number when storing to file to be stored According to library, file to be stored is stored into disk partition corresponding to database, the data base system of disk storage is realized, passes through disk The retrieval convenience to disk stored file may be implemented in the corresponding database of middle file;In addition, same disk passes through correspondence Multiple databases, so as to which disk is divided into multiple disks point on memory space according to the storage quantity of multiple databases Area, each disk partition can be managed independently and be stored, and the utilization efficiency of disk storage space is improved.
To make the above purposes, features and advantages of the invention more obvious and understandable, with reference to the accompanying drawing to the present invention Specific embodiment be described in detail.
Fig. 1 is a kind of flow chart of file memory method of the embodiment of the present invention.
The file memory method can be used for terminal equipment side.That is, terminal equipment side can execute shown in Fig. 1 Each step of method, file to be stored is stored in the disk to terminal device.
File memory method shown in Fig. 1 may comprise steps of:
Step S101: obtaining the attribute information of file to be stored, using the record as the file to be stored;
Step S102: the remaining storage quantity of the corresponding database of the file to be stored is determined;
Step S103: if the residue storage quantity is non-zero, described in the record deposit by the file to be stored Database, and the file to be stored is stored to disk, the file in the disk and at least one database have mapping Relationship.
In specific implementation, the attribute information of file to be stored can indicate file to be stored relevant information, such as can be with table Show the size, type, source etc. of file to be stored.The file to be stored can be what terminal device collected, can also be with It is that other equipment are sent to terminal device.The file to be stored specifically can be video, audio, picture, document etc..
The record of file to be stored is referred to as the tuple of file to be stored, and the attribute information of a file to be stored can To form a record.Record can be stored in database.
The storage quantity of database can be it is preset, such as database 1 storage quantity be 100,000.In step In the specific implementation of S102, before file to be stored to be stored to the disk to terminal device, need first to judge in database Remaining storage quantity.Specifically, different types of file to be stored can store into different databases, so only judge The remaining storage quantity of the corresponding database of file to be stored.
In the specific implementation of step S103, if the residue storage quantity is non-zero, indicate to deposit in database Enter new record, then the record of file to be stored can be stored in the database, and the file to be stored was stored to end In the disk of end equipment.
In addition, the file and at least one database in disk have mapping relations.
The file one in record and disk in the case where disk and single database have mapping relations, in database One is corresponding, and the data base system management to disk stored file may be implemented.Due to database may be implemented to every record It retrieves rapid, therefore the retrieval convenience to file in disk may be implemented by database.
In the case where disk and multiple databases have mapping relations, multiple databases can have different storage numbers Amount.In the fixed-size situation of each file, according to the difference of the storage quantity of multiple databases, according to different storage numbers The difference for recording occupied memory space of amount, disk are divided into multiple disk partition.Wherein, multiple disk partition and more A database has mapping relations.
For example, disk partition 1 and database 1 have mapping relations, disk partition 2 and database 2 have mapping relations, that The storage that the storage size that file pointed by all records in database 1 occupies is less than or equal to disk partition 1 is empty Between size, the storage size that file pointed by all records in database 2 occupies is less than or equal to depositing for disk partition 2 Store up space size.
That is, the corresponding disk partition of database has residue when the remaining storage quantity of database is non-zero Memory space, the disk partition can be stored in new file.
It is understood that the disk partition in the present embodiment is not subregion physically, it is only empty according to different storages Between size by disk divide for different storage sections.
The embodiment of the present invention stores the attribute information of file to be stored to data when storing to file to be stored File to be stored is stored disk partition corresponding to database, the data base system of disk storage is realized, by disk by library The retrieval convenience to disk stored file may be implemented in the corresponding database of file;In addition, same disk is more by correspondence A database, so as to which disk is divided into multiple disks point on memory space according to the storage quantity of multiple databases Area, each disk partition can be managed independently and be stored, and the utilization efficiency of disk storage space is improved.
In specific application scenarios, Internet of Things includes multiple terminal devices and cloud server, and file to be stored is view Frequently.When server needs to carry out the video of terminal quick-searching and uploads on demand beyond the clouds, terminal device by pair Database is retrieved, can be with quick-searching and the video file that navigates to the video file in disk, and will retrieve in time Upload to cloud server.
In a preferred embodiment of the invention, file memory method shown in Fig. 1 can be the following steps are included: if institute Stating remaining storage quantity is zero, then deletes the record of storage in the database and delete described stored pointed by record Storage file, the storage file is stored in the disk.
In the present embodiment, due to the limited amount of record storable in database, namely total storage quantity is limited, therefore When remaining storage quantity is zero, database will not be able to be stored in new record, then the record of storage file will not be able to by It is stored in database.
In this case, it in order to guarantee that the record of storage file can be stored effectively, can delete in database The storage file storage record and its be directed toward, so that the record and disk of file to be stored can be stored in database In can be stored in new file.
In the embodiment of the present invention, in the case where database has been expired, it can be realized by deleting existing record to working as The storage of preceding file to be stored realizes the validity of file storage.
Further, described to have stored the storage time that record includes the storage file.It is described to delete the data Having stored record and having deleted the record pointed storage file that stored in library may comprise steps of: at least Record has been stored according to the determination of the storage time of records all in the database is described;Described stored is deleted to record and delete The pointed storage file of record has been stored except described.
In a specific embodiment of the invention, referring to figure 2., according at least in the database when storage of all records Between determine and described stored record and may comprise steps of:
Step S201: determine storage time in the database it is earliest be recorded as described stored record.
In the present embodiment, in the case where database has been expired, the earliest record of storage time can be deleted, to realize to working as The storage of preceding file to be stored realizes timely updating for database and its corresponding disk partition.
It is described when to have stored record include the locking starting of the storage file in another of the invention specific embodiment Between and locking duration;Having stored record described in storage time determination according at least to all records in the database may include Following steps:
Step S202: if the earliest record of storage time is in the lock state in the database, it is determined that in not What storage time was earliest in the record of lock state be recorded as it is described stored record, record and be in the lock state when referring to current It carves in time range defined by locking initial time and locking duration in the record.
In specific implementation, it is pre-set that locking initial time and locking duration can be user.
In the present embodiment, in the case where database has been expired, for the record being in the lock state, the record and its direction File cannot be deleted, such as can be file of high importance, and then realize the flexibility that file storage updates.
In another specific embodiment of the invention, if all records are in lock state in the database, Status request is sent to server, so that the server is determined in response to the status request deletes instruction, record is in lock Determine state and refers to that current time is in time range defined by the locking initial time and locking duration of the record;Response Record has been stored described in determining in the deletion instruction of the server, and has stored record described in deletion and has deleted described deposited The pointed storage file of storage record.
The embodiment of the present invention can be used under the scene that terminal device is interacted with server.All records in the database When being under lock state, terminal device can send to server and request, and server can determine deletion instruction.Wherein, Deleting can indicate that the storage to be deleted records in instruction.
It should be noted that the concrete mode embodiment of the present invention for having stored record to be deleted of server determination does not limit System, for example, can be determine the storage time that is in the lock state it is earliest be recorded as the storage to be deleted record etc..
In another specific embodiment of the invention, the file to be stored is determined according to the source of the file to be stored Corresponding database;Determine the remaining storage quantity of the database.
In specific implementation, the record of the file to be stored of separate sources be can store into different databases.It thus can With elder generation according to the source determination database to be stored of file to be stored, then judge the remaining storage quantity of the database.In turn, Different processing modes can be taken to store the file to be stored according to remaining storage quantity.
Specific processing mode is referred to previous embodiment, and details are not described herein again.
In a kind of specific embodiment of the present invention, the attribute information of the file to be stored includes file size, files classes The identification information of type, message digest value and/or associated record.
Specifically, the message digest value of the file to be stored can be MD5 value, message digest value can be used for treating Storage file is verified.
The identification information of the associated record of file to be stored refers to the mark of other records associated with file to be stored Information.It can quickly locate and there are multiple records of incidence relation, be conducive to pair by the identification information of associated record The quick-searching of multiple associated records and positioning realize the association process management to file.
Referring to figure 3., file storage device 30 may include record determining module 301, remaining storage quantity determining module 302 and first memory module 303.
Wherein, record determining module 301 is suitable for obtaining the attribute information of file to be stored, using as the file to be stored Record;Remaining storage quantity determining module 302 is adapted to determine that the remaining storage number of the corresponding database of the file to be stored Amount;First memory module 303 is suitable for that the record of the file to be stored is stored in institute when the remaining storage quantity is non-zero Database is stated, and the file to be stored is stored to disk, the file in the disk has at least one database to be reflected Penetrate relationship.
The embodiment of the present invention stores the attribute information of file to be stored to data when storing to file to be stored File to be stored is stored disk partition corresponding to database, the data base system of disk storage is realized, by disk by library The retrieval convenience to disk stored file may be implemented in the corresponding database of file;In addition, same disk is more by correspondence A database, so as to which disk is divided into multiple disks point on memory space according to the storage quantity of multiple databases Area, each disk partition can be managed independently and be stored, and the utilization efficiency of disk storage space is improved.
In a preferred embodiment of the invention, with continued reference to Fig. 3, file storage device 30 can also include the second storage mould Block 304, suitable for deleting described in the record of storage and the deletion in the database when the remaining storage quantity is zero The pointed storage file of storage record, the storage file are stored in the disk.
In the embodiment of the present invention, in the case where database has been expired, it can be realized by deleting existing record to working as The storage of preceding file to be stored realizes the validity of file storage.
It is described to have stored the storage time that record includes the storage file in a specific embodiment of the invention;Institute Stating the second memory module may include: to have stored record determination unit, suitable for according at least to all records in the database Storage time has stored record described in determining;First deletes unit, suitable for deleting described stored described in record and deletion The pointed storage file of storage record.
Further, the record that stored includes the locking initial time of storage file and locking duration;Institute Stating and having stored record determination unit includes: the first determining subelement, is adapted to determine that the note that storage time is earliest in the database Record has stored record to be described;Second determines that subelement, the record earliest suitable for storage time in the database are in lock When determining state, determine storage time in the record in unlocked state it is earliest be recorded as it is described stored record, at record Refer to that current time is in time range defined by the locking initial time and locking duration of the record in lock state.
In the embodiment of the present invention, in the case where database has been expired, the earliest record of storage time can be deleted, to realize Storage to current file to be stored realizes timely updating for database and its corresponding disk partition.In addition, for place In the record of lock state, the file of the record and its direction cannot be deleted, such as can be file of high importance, And then realize the flexibility that file storage updates.
It is described when to have stored record include the locking starting of the storage file in another of the invention specific embodiment Between and locking duration;Second memory module includes: status request transmission unit, is suitable for all records in the database When being in lock state, status request is sent to server, so that the server is deleted in response to status request determination Except instruction, record, which is in the lock state, refers to that current time is in the locking initial time of the record and locking duration is limited Time range in;Second deletes unit, and the deletion for being adapted for the server instructs determination is described to store record, and It deletes described stored and has stored the pointed storage file of record described in record and deletion.
The present invention has in a specific embodiment, and the determining module of residue storage quantity shown in Fig. 3 302 may include: data Library determination unit, suitable for determining the corresponding database of the file to be stored according to the source of the file to be stored;Residue is deposited Quantity determination unit is stored up, is adapted to determine that the remaining storage quantity of the database.
Working principle, more contents of working method about the file storage device 30, are referred to Fig. 1 to Fig. 2 In associated description, which is not described herein again.
The embodiment of the invention also discloses a kind of storage mediums, are stored thereon with computer instruction, the computer instruction The step of file memory method shown in fig. 1 or fig. 2 can be executed when operation.The storage medium may include ROM, RAM, Disk or CD etc..The storage medium can also include non-volatility memorizer (non-volatile) or non-transient (non-transitory) memory etc..
The embodiment of the invention also discloses a kind of terminal, the terminal may include memory and processor, the storage The computer instruction that can be run on the processor is stored on device.The processor can be with when running the computer instruction The step of executing file memory method shown in fig. 1 or fig. 2.The terminal includes but is not limited to mobile phone, computer, plate electricity The terminal devices such as brain.
Although present disclosure is as above, present invention is not limited to this.Anyone skilled in the art are not departing from this It in the spirit and scope of invention, can make various changes or modifications, therefore protection scope of the present invention should be with claim institute Subject to the range of restriction.

Claims (16)

1. a kind of file memory method characterized by comprising
The attribute information for obtaining file to be stored, using the record as the file to be stored;
Determine the remaining storage quantity of the corresponding database of the file to be stored;
If the residue storage quantity is non-zero, the record of the file to be stored is stored in the database, and by institute It states file to be stored to store to disk, the file in the disk and at least one database have mapping relations.
2. file memory method according to claim 1, which is characterized in that further include:
If the residue storage quantity is zero, deletes the record of storage in the database and delete described stored The pointed storage file of record, the storage file are stored in the disk.
3. file memory method according to claim 2, which is characterized in that the record that stored includes described stored The storage time of file;Having stored in the deletion database has been stored described in record and deletion pointed by record Storage file includes:
Record has been stored described in storage time determination according at least to all records in the database;
It deletes described stored and has stored the pointed storage file of record described in record and deletion.
4. file memory method according to claim 3, which is characterized in that the record that stored includes described stored The locking initial time and locking duration of file;The storage time according at least to all records in the database determines institute It states and has stored record and include:
Determine storage time in the database it is earliest be recorded as described stored record;
Alternatively, if the earliest record of storage time is in the lock state in the database, it is determined that be in unlocked state Record in storage time it is earliest be recorded as it is described stored record, record to be in the lock state and refer to that current time is in institute It states in time range defined by the locking initial time and locking duration of record.
5. file memory method according to claim 2, which is characterized in that the record that stored includes described stored The locking initial time and locking duration of file;It has been deposited described in the record of storage deleted in the database and deletion Storage records pointed storage file
If all records are in lock state in the database, status request is sent to server, so that the clothes Device be engaged in response to the determining deletion instruction of the status request, record, which is in the lock state, refers to that current time is in the record It locks in time range defined by initial time and locking duration;
In response to the server deletion instruction determine it is described stored record, and stored record and deletion described in deleting It is described to have stored the pointed storage file of record.
6. file memory method according to claim 1, which is characterized in that the determination file to be stored is corresponding The remaining storage quantity of database includes:
The corresponding database of the file to be stored is determined according to the source of the file to be stored;
Determine the remaining storage quantity of the database.
7. file memory method according to any one of claims 1 to 6, which is characterized in that the category of the file to be stored Property information includes the identification information of file size, file type, message digest value and/or associated record.
8. a kind of file storage device characterized by comprising
Determining module is recorded, suitable for obtaining the attribute information of file to be stored, using the record as the file to be stored;
Remaining storage quantity determining module is adapted to determine that the remaining storage quantity of the corresponding database of the file to be stored;
First memory module is suitable for that the record of the file to be stored is stored in institute when the remaining storage quantity is non-zero Database is stated, and the file to be stored is stored to disk, the file in the disk has at least one database to be reflected Penetrate relationship.
9. file storage device according to claim 8, which is characterized in that further include:
Second memory module, suitable for when the remaining storage quantity is zero, delete the record of storage in the database with And delete described stored and record pointed storage file, the storage file is stored in the disk.
10. file storage device according to claim 9, which is characterized in that the record that stored includes described deposited Store up the storage time of file;Second memory module includes:
Record determination unit has been stored, has determined described deposited suitable for the storage time according at least to all records in the database Storage record;
First deletes unit, and the pointed text of storage of record has been stored described in record and deletion suitable for deleting described stored Part.
11. file storage device according to claim 10, which is characterized in that the record that stored includes described deposited Store up the locking initial time and locking duration of file;It is described stored record determination unit include:
First determines subelement, be adapted to determine that storage time in the database it is earliest be recorded as described stored record;
Second determination subelement, when the record earliest suitable for storage time in the database is in the lock state, at determination What storage time was earliest in the record of unlocked state be recorded as it is described stored record, record to be in the lock state and refer to and work as The preceding moment is in time range defined by the locking initial time and locking duration of the record.
12. file storage device according to claim 9, which is characterized in that the record that stored includes described deposited Store up the locking initial time and locking duration of file;Second memory module includes:
Status request transmission unit, suitable for sending status request when all records are in lock state in the database To server, so that the server is determined in response to the status request deletes instruction, record, which is in the lock state, to be referred to and works as The preceding moment is in time range defined by the locking initial time and locking duration of the record;
Second deletes unit, be adapted for the server deletion instruction determine it is described stored record, and described in deletion It has stored record and has deleted described stored and recorded pointed storage file.
13. file storage device according to claim 8, which is characterized in that the residue storage quantity determining module packet It includes:
Database determination unit, suitable for determining the corresponding data of the file to be stored according to the source of the file to be stored Library;
Remaining storage quantity determination unit is adapted to determine that the remaining storage quantity of the database.
14. according to the described in any item file storage devices of claim 8 to 13, which is characterized in that the file to be stored Attribute information includes the identification information of file size, file type, message digest value and/or associated record.
15. a kind of storage medium, is stored thereon with computer instruction, which is characterized in that the computer instruction executes when running Described in any one of claims 1 to 7 the step of file memory method.
16. a kind of terminal, including memory and processor, the meter that can be run on the processor is stored on the memory Calculation machine instruction, which is characterized in that perform claim requires any one of 1 to 7 institute when the processor runs the computer instruction The step of stating file memory method.
CN201810940755.8A 2018-08-17 2018-08-17 File memory method and device, storage medium, terminal Pending CN109213444A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810940755.8A CN109213444A (en) 2018-08-17 2018-08-17 File memory method and device, storage medium, terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810940755.8A CN109213444A (en) 2018-08-17 2018-08-17 File memory method and device, storage medium, terminal

Publications (1)

Publication Number Publication Date
CN109213444A true CN109213444A (en) 2019-01-15

Family

ID=64988561

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810940755.8A Pending CN109213444A (en) 2018-08-17 2018-08-17 File memory method and device, storage medium, terminal

Country Status (1)

Country Link
CN (1) CN109213444A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111767009A (en) * 2020-06-24 2020-10-13 中国工商银行股份有限公司 Disk cleaning method, device and equipment
CN111782148A (en) * 2020-06-30 2020-10-16 中国工商银行股份有限公司 Data storage control method and device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103680541A (en) * 2012-09-19 2014-03-26 上海博泰悦臻电子设备制造有限公司 Music storage device for vehicle-mounted equipment
CN105279213A (en) * 2015-03-13 2016-01-27 中国移动通信集团广东有限公司 Retrieval device and retrieval method for log database
CN105718515A (en) * 2016-01-14 2016-06-29 神策网络科技(北京)有限公司 Data storage system and method and data analysis system and method
CN105740425A (en) * 2016-01-29 2016-07-06 宇龙计算机通信科技(深圳)有限公司 File storage method and apparatus
US9875249B1 (en) * 2015-03-31 2018-01-23 Maginatics Llc Reducing database fragmentation
CN108319602A (en) * 2017-01-17 2018-07-24 广州市动景计算机科技有限公司 Data base management method and Database Systems

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103680541A (en) * 2012-09-19 2014-03-26 上海博泰悦臻电子设备制造有限公司 Music storage device for vehicle-mounted equipment
CN105279213A (en) * 2015-03-13 2016-01-27 中国移动通信集团广东有限公司 Retrieval device and retrieval method for log database
US9875249B1 (en) * 2015-03-31 2018-01-23 Maginatics Llc Reducing database fragmentation
CN105718515A (en) * 2016-01-14 2016-06-29 神策网络科技(北京)有限公司 Data storage system and method and data analysis system and method
CN105740425A (en) * 2016-01-29 2016-07-06 宇龙计算机通信科技(深圳)有限公司 File storage method and apparatus
CN108319602A (en) * 2017-01-17 2018-07-24 广州市动景计算机科技有限公司 Data base management method and Database Systems

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111767009A (en) * 2020-06-24 2020-10-13 中国工商银行股份有限公司 Disk cleaning method, device and equipment
CN111782148A (en) * 2020-06-30 2020-10-16 中国工商银行股份有限公司 Data storage control method and device, electronic equipment and storage medium
CN111782148B (en) * 2020-06-30 2023-09-05 中国工商银行股份有限公司 Data storage control method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
US8799601B1 (en) Techniques for managing deduplication based on recently written extents
CN106201771B (en) Data-storage system and data read-write method
US10509701B2 (en) Performing data backups using snapshots
US11409652B2 (en) Estimating worker nodes needed for performing garbage collection operations
CN102629247B (en) Method, device and system for data processing
CN109522283B (en) Method and system for deleting repeated data
CN110046133A (en) A kind of metadata management method, the apparatus and system of storage file system
CN109063192B (en) Working method of high-performance mass file storage system
CN108196787B (en) Quota management method of cluster storage system and cluster storage system
US11392490B2 (en) Marking impacted similarity groups in garbage collection operations in deduplicated storage systems
CN109446177B (en) Method and device for realizing number quota of directory files of distributed file system
CN111090618B (en) Data reading method, system and equipment
CN108614837B (en) File storage and retrieval method and device
CN109240607B (en) File reading method and device
US20170031959A1 (en) Scheduling database compaction in ip drives
CN103605585A (en) Intelligent backup method based on data discovery
CN111177143B (en) Key value data storage method and device, storage medium and electronic equipment
WO2020125630A1 (en) File reading
WO2020215580A1 (en) Distributed global data deduplication method and device
US20200310965A1 (en) Deleting data in storage systems that perform garbage collection
CN107273368A (en) Mass data storage management method, device and data-storage system
CN110209736A (en) Device, method and the storage medium of block chain data processing
CN109213444A (en) File memory method and device, storage medium, terminal
CN111930556A (en) Backup method and device for distributed storage data
CN114610680A (en) Method, device and equipment for managing metadata of distributed file system and storage medium

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
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20190115