CN109408462A - A kind of document storage management method and electronic equipment based on educational system - Google Patents

A kind of document storage management method and electronic equipment based on educational system Download PDF

Info

Publication number
CN109408462A
CN109408462A CN201811082393.XA CN201811082393A CN109408462A CN 109408462 A CN109408462 A CN 109408462A CN 201811082393 A CN201811082393 A CN 201811082393A CN 109408462 A CN109408462 A CN 109408462A
Authority
CN
China
Prior art keywords
unique encodings
file
database
encodings
unique
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.)
Withdrawn
Application number
CN201811082393.XA
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.)
Shenzhen Dianmao Technology Co Ltd
Original Assignee
Shenzhen Dianmao 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 Shenzhen Dianmao Technology Co Ltd filed Critical Shenzhen Dianmao Technology Co Ltd
Priority to CN201811082393.XA priority Critical patent/CN109408462A/en
Publication of CN109408462A publication Critical patent/CN109408462A/en
Withdrawn legal-status Critical Current

Links

Landscapes

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

Abstract

The present invention discloses a kind of document storage management method and electronic equipment based on educational system, wherein method comprising steps of A, when needing storage file in the database, Hash operation is carried out to the file and generates corresponding unique encodings;B, it is retrieved in the database according to the unique encodings with the presence or absence of identical unique encodings;C, when there are identical unique encodings, then by the unique encodings, count is incremented;When identical unique encodings are not present, then database is written into the unique encodings, and counted and be calculated as 1, and corresponding file is stored to database.Through the invention, when storing same file, a space is only taken up, under the scene of a large amount of duplicate files, memory space really occupies reduction, and improves search efficiency.

Description

A kind of document storage management method and electronic equipment based on educational system
Technical field
The present invention relates to field of computer technology more particularly to a kind of document storage management method based on educational system and Electronic equipment.
Background technique
In server file storing process, the file of different user storage can have the case where repeating, if directly storing A large amount of memory spaces can be occupied, the utilization rate of server storage is reduced.Meanwhile for file already present for server, use Family uploads and is also required to upload again with text document, also occupies time and the bandwidth of user.
Therefore, the existing technology needs to be improved and developed.
Summary of the invention
In view of above-mentioned deficiencies of the prior art, the file storage based on educational system that the purpose of the present invention is to provide a kind of Management method and electronic equipment, it is intended to solve file in the prior art and store the problems such as being easy wasting space, reduction utilization rate.
Technical scheme is as follows:
A kind of document storage management method based on educational system, wherein comprising steps of
A, when needing storage file in the database, Hash operation is carried out to the file and generates corresponding unique volume Code;
B, it is retrieved in the database according to the unique encodings with the presence or absence of identical unique encodings;
C, when there are identical unique encodings, then by the unique encodings, count is incremented;When there is no identical unique When coding, then database is written into the unique encodings, and counted and be calculated as 1, and corresponding file is stored to database.
The document storage management method based on educational system, wherein in the step C, when there are it is identical only When one coding, then by the unique encodings, count is incremented, while the corresponding relationship of the file path of file and unique encodings being write Enter database;When identical unique encodings are not present, then database is written into the unique encodings, and counted and be calculated as 1, And corresponding file is stored to database, while data are written into the corresponding relationship of the file path of file and unique encodings Library.
The document storage management method based on educational system, wherein in the step C, when there is no identical When unique encodings, file is stored using the unique encodings as file name to database.
The document storage management method based on educational system, wherein after the step C further include:
When needing to delete file in the database, then the file path pair for the file deleted needed for retrieval in the database The unique encodings answered;
When retrieving corresponding unique encodings, then the counting of the unique encodings is subtracted 1, and deletes the file path With the corresponding relationship of unique encodings.
The document storage management method based on educational system, wherein when not retrieving corresponding unique encodings, Then directly exit process.
The document storage management method based on educational system, wherein when retrieving corresponding unique encodings, then The counting of the unique encodings is subtracted 1, and the step of deleting the corresponding relationship of the file path and unique encodings specifically includes:
When retrieving corresponding unique encodings, the counting of the unique encodings is obtained;
When the counting of the unique encodings is greater than 1, then the counting of the unique encodings is subtracted 1, and delete the file The corresponding relationship in path and unique encodings;
When the counting of the unique encodings is equal to 1, then the counting of the unique encodings is subtracted 1, and delete the file The corresponding relationship in path and unique encodings, while corresponding file is deleted in the database.
The document storage management method based on educational system, wherein the unique encodings are to pass through Hash operation The cryptographic Hash of generation.
A kind of electronic equipment, wherein include:
Processor is adapted for carrying out each instruction, and
Equipment is stored, is suitable for storing a plurality of instruction, described instruction is suitable for being loaded and being executed by processor:
When needing storage file in the database, Hash operation is carried out to the file and generates corresponding unique encodings;
It is retrieved in the database according to the unique encodings with the presence or absence of identical unique encodings;
When there are identical unique encodings, then by the unique encodings, count is incremented;When there is no identical unique volumes When code, then database is written into the unique encodings, and counted and be calculated as 1, and corresponding file is stored to database.
A kind of non-volatile computer readable storage medium storing program for executing, wherein the non-volatile computer readable storage medium storing program for executing is deposited Computer executable instructions are contained, when which is executed by one or more processors, may make described one A or multiple processors execute the document storage management method based on educational system.
A kind of computer program product, wherein non-volatile computer is readable to be deposited computer program product including being stored in Computer program on storage media, computer program include program instruction, when program instruction is executed by processor, make the place It manages device and executes the document storage management method based on educational system.
The utility model has the advantages that through the invention, when storing same file, a space is only taken up, in a large amount of duplicate files Scene under, memory space really occupies reduction, also very fast for file search in memory space, improves search effect Rate.
Detailed description of the invention
Fig. 1 is a kind of flow chart of the document storage management method preferred embodiment based on educational system of the present invention.
Fig. 2 is the structural block diagram of a kind of electronic equipment preferred embodiment of the present invention.
Specific embodiment
The present invention provides a kind of document storage management method and electronic equipment based on educational system, to make mesh of the invention , technical solution and effect it is clearer, clear, the present invention is described in more detail below.It should be appreciated that described herein Specific embodiment be only used to explain the present invention, be not intended to limit the present invention.
Referring to Fig. 1, Fig. 1 is a kind of stream of the document storage management method preferred embodiment based on educational system of the present invention Cheng Tu, as shown, itself comprising steps of
S1, when needing storage file in the database, Hash operation is carried out to the file and generates corresponding unique volume Code;
S2, it is retrieved in the database according to the unique encodings with the presence or absence of identical unique encodings;
S3, when there are identical unique encodings, then by the unique encodings, count is incremented;When there is no it is identical only When one coding, then database is written into the unique encodings, and counted and be calculated as 1, and corresponding file is stored to data Library.
Through the invention, when storing same file, the space of text document is only taken up, in the scene of a large amount of duplicate files Under, memory space really occupies reduction, and it is also very fast for file search in memory space, improve search efficiency.
Specifically, in the step S1, when needing storage file in the database, Hash fortune is carried out to the file It calculates and generates corresponding unique encodings.
Unique encodings therein are the marks that Hash operation obtains, specific to can be the Hash generated by Hash operation Value.The cryptographic Hash is related with file content, and unrelated with file name.
Such as Hash operation is carried out to some file and obtains a cryptographic Hash, specially abcdefg, due to the Hash of file Operation is only related to file content, unrelated with file name, as long as cryptographic Hash is unanimously i.e. it is believed that file content is consistent.In this way, The present invention just mutually separates file content with the file information, is convenient for storage management.
That is, the present invention is when needing for a local file to be uploaded in database, first to local file Hash operation is carried out, to obtain unique encodings, unique encodings therein are preferably cryptographic Hash, to facilitate subsequent retrieved.
In the step S2, retrieved in the database according to the unique encodings with the presence or absence of identical unique encodings. Whether retrieval is to judge to have in database and the local file to be uploaded with the presence or absence of the purpose of identical unique encodings Identical file, where like file does not refer to corresponding file name, and refers to identical file content.Due to above-mentioned Unique encodings are related with file content, and unrelated with file name, as long as so unique encodings are identical, it can be in supporting paper Hold identical.Since file name appearance is easily modified, retrieved in the way of file name, it is clear that it will appear various mistakes, It is correct that storage method through the invention can ensure that subsequent step executes.
In the step S3, when there are identical unique encodings, then by the unique encodings, count is incremented;When not There are when identical unique encodings, then database is written into the unique encodings, and is counted and be calculated as 1, and by corresponding text Part is stored to database.
If there is identical unique encodings, then identical file is stored in database of descriptions, so can be counted Number plus 1 indicates to store an identical file again in the database, not true storage file herein, only need by Count is incremented for it, and representative has increased a storing process newly and also eliminated simultaneously to save the memory space of database The process locally uploaded improves storage efficiency, saves bandwidth.
If there is no identical unique encodings, then identical file is not stored in database of descriptions, so can incite somebody to action Database is written in the unique encodings, and is counted and be calculated as 1.Just have recorded the storage number of file in the database in this way, Current storage number is 1.
In addition, storing file to database.Storage herein is really to store, i.e., stores one in the database very Real file, but for identical file, it also only needs storing a true file for the first time, can reduce deposit in this way Number is stored up, storage efficiency is improved, it is prior to facilitate retrieval.
Further, in the step S3, when there are identical unique encodings, then the counting of the unique encodings is added 1, while database is written into the corresponding relationship of the file path of file and unique encodings.
That is, not only being counted increase by 1, while also by the file of file for the case where there are identical unique encodings Database is written in the corresponding relationship of path and unique encodings, and file path therein refers to that file is stored in local file road Diameter, that is to say, that be equivalent to and inform that user's this document from a local place storage to database, also facilitates user in this way This document is searched in the database is stored in local position.
When identical unique encodings are not present, then database is written into the unique encodings, and counted and be calculated as 1, And corresponding file is stored to database, while data are written into the corresponding relationship of the file path of file and unique encodings Library.
That is, the case where for identical unique encodings are not present, not only counted and be calculated as 1, while also by the text of file Database is written in the corresponding relationship of part path and unique encodings, and file path therein refers to that file is stored in local file road Diameter, that is to say, that be equivalent to and inform that user's this document from a local place storage to database, can equally facilitate in this way User searches this document in the database and is stored in local position.
Further, in the step S3, when be not present identical unique encodings when, by file using the unique encodings as File name is stored to database.
This document will be stored no longer with its original title, but its unique encodings is used to carry out as file name On the one hand storage, can be convenient retrieval file in the database in this way, on the other hand, also can avoid file name confusion, convenient Management.
Further, in the step S3, when corresponding relationship is written, go back while being written the size and type of file.In this way Can be convenient can have one probably to understand the essential information of this document.
Further, after the step S3 further include:
When needing to delete file in the database, then the file path pair for the file deleted needed for retrieval in the database The unique encodings answered;
When retrieving corresponding unique encodings, then the counting of the unique encodings is subtracted 1, and deletes the file path With the corresponding relationship of unique encodings.
It i.e. in the file for needing to delete database, needs to retrieve its unique encodings, specifically, is carrying out delete operation When, can first obtain the file path of local file, then according to the file path in the database retrieve with the presence or absence of pair The unique encodings answered are stored with this document when retrieving corresponding unique encodings in database of descriptions, need to only be counted at this time Number subtract 1, can represent and delete 1 this document, at the same delete this document file path and unique encodings corresponding relationship i.e. It can.
Further, when not retrieving corresponding unique encodings, then directly exit process, in database it is not stored have it is identical File, without carrying out delete operation.
Further, when retrieving corresponding unique encodings, then the counting of the unique encodings is subtracted 1, and described in deletion The step of corresponding relationship of file path and unique encodings, specifically includes:
When retrieving corresponding unique encodings, the counting of the unique encodings is obtained;
When the counting of the unique encodings is greater than 1, then the counting of the unique encodings is subtracted 1, and delete the file The corresponding relationship in path and unique encodings;
When the counting of the unique encodings is equal to 1, then the counting of the unique encodings is subtracted 1, and delete the file The corresponding relationship in path and unique encodings, while corresponding file is deleted in the database.
The counting for first obtaining unique encodings is greater than 1 if counted, illustrates that this document is stored once incessantly, So directly can subtract 1, and delete the corresponding relationship of file path and unique encodings.
It is equal to 1 if counted, illustrates that this document is only stored once, so not only needing to be counted at this time to subtract 1, i.e., it directly deletes and counts, while also needing really to delete this document and corresponding corresponding relationship.
For example, it needs to be stored in file 1 in the database, then can execute as follows:
Hash operation, an available cryptographic Hash abcdefg, due to the Hash operation of file first are carried out to file 1 It is related to file content, it is unrelated with file name, as long as so cryptographic Hash is unanimously i.e. it is believed that file content is consistent.
Database is inquired using cryptographic Hash abcdefg as index, if successful inquiring, that is, have a same content File stored, it is only necessary to updating index is abcdefg corresponding countings increase by 1, while by file path and Hash Value carries out corresponding write-in database;If inquiry failure, i.e., without the file of the content, need to increase indexing for abcdefg The corresponding relationship of file path and cryptographic Hash is written to database in database, while also needing file using cryptographic Hash as text Part title actual stored is to database.
It for another example needs to delete file 1, then can execute as follows:
In the corresponding cryptographic Hash of the file path of data base querying file 1, if successful inquiring, it is known that there is entitled file 1 file has stored, if inquiry failure, it will be understood that file 1 is not present, is directly exited.
After successful inquiring, its counting is obtained to inquire obtained cryptographic Hash.It is greater than 1 if counting, it is believed that this document It is not only primary by storage, it only needs it to count at this time and reduces by 1, while the corresponding relationship that will need to delete file path and cryptographic Hash; Be equal to 1 if counting, it is believed that this document is only primary by storage, at this time not only in database counting and corresponding relationship delete It removes, while also needing really to delete corresponding file.
It is counted as described above, the present invention only has updated database for the storage of duplicate contents, truthful data storage is practical Text document space has been only taken up, under file largely duplicate situation, the occupied repetition of duplicate file will be greatly reduced Space.The file information storages such as file path of file in the database, are separated with file content storage simultaneously, search text The operation of part directly only needs to search for compared to conventional store, without scanning for entire database, directly from database search Also much more much faster than file search by the inquiry of database, file destination is quickly searched in realization from heap file.
The present invention also provides a kind of electronic equipment 10, as shown in Fig. 2, comprising:
Processor 110 is adapted for carrying out each instruction, and
Equipment 120 is stored, is suitable for storing a plurality of instruction, described instruction is suitable for being loaded and being executed by processor 110:
When needing storage file in the database, Hash operation is carried out to the file and generates corresponding unique encodings;
It is retrieved in the database according to the unique encodings with the presence or absence of identical unique encodings;
When there are identical unique encodings, then by the unique encodings, count is incremented;When there is no identical unique volumes When code, then database is written into the unique encodings, and counted and be calculated as 1, and corresponding file is stored to database.
The processor 110 can for general processor, digital signal processor (DSP), specific integrated circuit (ASIC), It is field programmable gate array (FPGA), single-chip microcontroller, ARM (Acorn RISCMachine) or other programmable logic device, discrete Any combination of door or transistor logic, discrete hardware component or these components.In addition, processor can also be any biography System processor, microprocessor or state machine.Processor also may be implemented as calculating the combination of equipment, for example, DSP and micro process Combination, multi-microprocessor, one or more microprocessors combination DSP core, any other this configuration of device.
It stores equipment 120 and is used as a kind of non-volatile computer readable storage medium storing program for executing, can be used for storing non-volatile software Program, non-volatile computer executable program and module, as the file based on educational system in the embodiment of the present invention is deposited Store up the corresponding program instruction of management method.Processor is stored in the non-volatile software program stored in equipment by operation, referred to It enables and unit, thereby executing the various function application and data processing of the document storage management method based on educational system, Realize above method embodiment.
It has been described in detail in the method for particular technique details in front about above-mentioned electronic equipment 10, so it will not be repeated.
The present invention also provides a kind of non-volatile computer readable storage medium storing program for executing, the non-volatile computer readable storage Media storage has computer executable instructions, when which is executed by one or more processors, may make One or more of processors execute the document storage management method based on educational system.
The present invention also provides a kind of computer program product, computer program product includes being stored in non-volatile computer Computer program on readable storage medium storing program for executing, computer program include program instruction, when program instruction is executed by processor, are made The processor executes the document storage management method based on educational system.
It should be understood that the application of the present invention is not limited to the above for those of ordinary skills can With improvement or transformation based on the above description, all these modifications and variations all should belong to the guarantor of appended claims of the present invention Protect range.

Claims (10)

1. a kind of document storage management method based on educational system, which is characterized in that comprising steps of
A, when needing storage file in the database, Hash operation is carried out to the file and generates corresponding unique encodings;
B, it is retrieved in the database according to the unique encodings with the presence or absence of identical unique encodings;
C, when there are identical unique encodings, then by the unique encodings, count is incremented;When there is no identical unique encodings When, then database is written into the unique encodings, and counted and be calculated as 1, and corresponding file is stored to database.
2. the document storage management method according to claim 1 based on educational system, which is characterized in that the step C In, when there are identical unique encodings, then by the unique encodings, count is incremented, while by the file path of file and only Database is written in the corresponding relationship of one coding;When identical unique encodings are not present, then data are written into the unique encodings Library, and counted and be calculated as 1, and corresponding file is stored to database, while by the file path and unique encodings of file Corresponding relationship be written database.
3. the document storage management method according to claim 1 based on educational system, which is characterized in that the step C In, when identical unique encodings are not present, file is stored using the unique encodings as file name to database.
4. the document storage management method according to claim 2 based on educational system, which is characterized in that the step C Later further include:
When needing to delete file in the database, then the file path for the file deleted needed for retrieval in the database is corresponding Unique encodings;
When retrieving corresponding unique encodings, then the counting of the unique encodings is subtracted 1, and deletes the file path and only The corresponding relationship of one coding.
5. the document storage management method according to claim 4 based on educational system, which is characterized in that when not retrieving When corresponding unique encodings, then process is directly exited.
6. the document storage management method according to claim 4 based on educational system, which is characterized in that when retrieving phase When the unique encodings answered, then the counting of the unique encodings is subtracted 1, and deletes the corresponding pass of the file path and unique encodings The step of being specifically includes:
When retrieving corresponding unique encodings, the counting of the unique encodings is obtained;
When the counting of the unique encodings is greater than 1, then the counting of the unique encodings is subtracted 1, and delete the file path With the corresponding relationship of unique encodings;
When the counting of the unique encodings is equal to 1, then the counting of the unique encodings is subtracted 1, and delete the file path With the corresponding relationship of unique encodings, while corresponding file is deleted in the database.
7. the document storage management method according to claim 1 based on educational system, which is characterized in that unique volume Code is the cryptographic Hash generated by Hash operation.
8. a kind of electronic equipment characterized by comprising
Processor is adapted for carrying out each instruction, and
Equipment is stored, is suitable for storing a plurality of instruction, described instruction is suitable for being loaded and being executed by processor:
When needing storage file in the database, Hash operation is carried out to the file and generates corresponding unique encodings;
It is retrieved in the database according to the unique encodings with the presence or absence of identical unique encodings;
When there are identical unique encodings, then by the unique encodings, count is incremented;When there is no identical unique encodings When, then database is written into the unique encodings, and counted and be calculated as 1, and corresponding file is stored to database.
9. a kind of non-volatile computer readable storage medium storing program for executing, which is characterized in that the non-volatile computer readable storage medium Matter is stored with computer executable instructions, when which is executed by one or more processors, may make institute It states one or more processors perform claim and requires the described in any item document storage management methods based on educational system of 1-7.
10. a kind of computer program product, which is characterized in that computer program product can including being stored in non-volatile computer The computer program on storage medium is read, computer program includes program instruction, when program instruction is executed by processor, makes institute It states processor perform claim and requires the described in any item document storage management methods based on educational system of 1-7.
CN201811082393.XA 2018-09-17 2018-09-17 A kind of document storage management method and electronic equipment based on educational system Withdrawn CN109408462A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811082393.XA CN109408462A (en) 2018-09-17 2018-09-17 A kind of document storage management method and electronic equipment based on educational system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811082393.XA CN109408462A (en) 2018-09-17 2018-09-17 A kind of document storage management method and electronic equipment based on educational system

Publications (1)

Publication Number Publication Date
CN109408462A true CN109408462A (en) 2019-03-01

Family

ID=65464909

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811082393.XA Withdrawn CN109408462A (en) 2018-09-17 2018-09-17 A kind of document storage management method and electronic equipment based on educational system

Country Status (1)

Country Link
CN (1) CN109408462A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022036927A1 (en) * 2020-08-19 2022-02-24 安徽鸿程光电有限公司 File storage method and apparatus, device, and medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022036927A1 (en) * 2020-08-19 2022-02-24 安徽鸿程光电有限公司 File storage method and apparatus, device, and medium

Similar Documents

Publication Publication Date Title
TWI682274B (en) Key-value store tree
US20220413706A1 (en) Data Storage Method, Apparatus and Storage System
TWI702506B (en) System, machine readable medium, and machine-implemenated method for merge tree garbage metrics
US8706710B2 (en) Methods for storing data streams in a distributed environment
US8738572B2 (en) System and method for storing data streams in a distributed environment
CN103136243B (en) File system duplicate removal method based on cloud storage and device
CN106484906B (en) Distributed object storage system flash-back method and device
JP2005122702A5 (en)
CN103595797B (en) Caching method for distributed storage system
CN103795811B (en) Information storage and data statistical management method based on meta data storage
CN110888837B (en) Object storage small file merging method and device
CN107391544B (en) Processing method, device and equipment of column type storage data and computer storage medium
US11625412B2 (en) Storing data items and identifying stored data items
CN108268216B (en) Data processing method, device and server
WO2020125630A1 (en) File reading
CN110287201A (en) Data access method, device, equipment and storage medium
US10423580B2 (en) Storage and compression of an aggregation file
WO2016101758A1 (en) Cross-cluster data synchronization method and device
CN110352410A (en) Track the access module and preextraction index node of index node
CN109408462A (en) A kind of document storage management method and electronic equipment based on educational system
CN111045994B (en) File classification retrieval method and system based on KV database
CN107533562A (en) The serialisation scheme of data storage and lightweight index on the equipment for only adding magnetic track band
CN105046162B (en) The caching safeguarded in content addressable storage systems and father is mapped using son
CN110232050A (en) The method and electronic equipment that a kind of language based on programming compresses file
US10037148B2 (en) Facilitating reverse reading of sequentially stored, variable-length data

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

Application publication date: 20190301