CN111078650A - File storage method - Google Patents
File storage method Download PDFInfo
- Publication number
- CN111078650A CN111078650A CN201911323288.5A CN201911323288A CN111078650A CN 111078650 A CN111078650 A CN 111078650A CN 201911323288 A CN201911323288 A CN 201911323288A CN 111078650 A CN111078650 A CN 111078650A
- Authority
- CN
- China
- Prior art keywords
- name
- file
- directory
- files
- value
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/17—Details of further file system functions
- G06F16/172—Caching, prefetching or hoarding of files
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/14—Details of searching files based on file metadata
- G06F16/148—File search processing
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Library & Information Science (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a file storage method, which comprises the following steps: s1, obtaining an operation user name K of the current uploaded file, and defining a value function b (K) of the operation user name K: (K) ═ K mod M; taking the operation result of the value function b (K) as the name of a first-level directory; s2, acquiring the current year and month Y, and calculating a value function b (Y): (Y) Y mod M, the operation result is used as the name of the secondary directory; s3, acquiring a file step length variable value n set by the system; s4, acquiring the file name Z of the uploaded file, and calculating a value function P (Z) of the file name Z; s5, mixing the P (Z) value obtained in S4 with 2n-1 performing a bitwise and operation to obtain a name of a tertiary directory; and S6, storing the file in the corresponding directory. The invention respectively stores the user name, the date and the file name in the three-level directory, can solve the problem that the files in the same folder are too many when the files are uploaded and stored in the B/S architecture, can search the files in various ways and improves the reading efficiency and the reading performance of the files.
Description
Technical Field
The invention belongs to the technical field of file storage, and particularly relates to a file storage method.
Background
In the model of the B/S architecture, when an end user saves a file, a folder is created on a server (usually a file server) by the user' S operation, and then the file is saved under the folder.
With the increase of the use time of the system or the frequent operation of files by a user, the files in a certain folder may be excessive, so that the searching is inconvenient and the reading performance of the files is affected.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provide a file storage method which can respectively store a user name, a date and a file name in a three-level directory, can search files in various ways and can improve the reading efficiency and performance of the files.
The purpose of the invention is realized by the following technical scheme: a file storage method comprising the steps of:
s1, obtaining an operation user name K of the current uploaded file, and defining a value function b (K) of the operation user name K:
b(K)=K mod M
wherein mod is a remainder function, and M is an arbitrary prime number;
taking the operation result of the value function b (K) as the name of a first-level directory;
s2, acquiring the current date Y, and calculating a value function b (Y) of the current date Y:
b(Y)=Y mod M
using the operation result as the name of the secondary directory;
s3, acquiring a file step length variable value n set by the system;
s4, acquiring the file name Z of the uploaded file, and calculating a value function P (Z):
s5, mixing the P (Z) value obtained in S4 with 2n-1 bitwise and operation to obtain the name of the tertiary directory;
and S6, respectively storing the user name, the date and the file name in corresponding directories.
The invention has the beneficial effects that: the invention respectively stores the user name, the date and the file name in the three-level directory, can solve the problem that the files in the same folder are too many when the files are uploaded and stored in the B/S architecture, can search the files in various ways and improves the reading efficiency and the reading performance of the files.
Detailed Description
The technical solution of the present invention is further explained below.
The invention discloses a file storage method, which comprises the following steps:
s1, obtaining an operation user name K of the current uploaded file, and defining a value function b (K) of the operation user name K:
b(K)=K mod M
wherein mod is a remainder function, and M is an arbitrary prime number;
taking the operation result of the value function b (K) as the name of a first-level directory;
s2, obtaining the current date Y (generally adopting a month-of-year format yyyy-MM, for example 2109-12), and calculating a value function b (Y):
b(Y)=Y mod M
using the operation result as the name of the secondary directory;
s3, acquiring a file step length variable value n set by the system;
s4, obtaining the file name Z of the uploaded file, including the suffix name thereof, such as (example. zip); calculating a value function P (Z):
s5, carrying out bitwise AND operation on the P (Z) value obtained in the S4 and the 2n-1 bitwise value (converting the obtained value into a 2-system number, and carrying out bitwise AND operation on the number) to obtain the name of the tertiary directory;
s6, through the steps, the files are finally and evenly distributed into the three-level directories, and the maximum number of the three-level directories is (2)n-1), directly storing the uploaded original files in a third-level directory, and then respectively storing user names, dates and file names in corresponding purposesAnd (5) recording.
It will be appreciated by those of ordinary skill in the art that the embodiments described herein are intended to assist the reader in understanding the principles of the invention and are to be construed as being without limitation to such specifically recited embodiments and examples. Those skilled in the art can make various other specific changes and combinations based on the teachings of the present invention without departing from the spirit of the invention, and these changes and combinations are within the scope of the invention.
Claims (1)
1. A file storage method, comprising the steps of:
s1, obtaining an operation user name K of the current uploaded file, and defining a value function b (K) of the operation user name K:
b(K)=K mod M
wherein mod is a remainder function, and M is an arbitrary prime number;
taking the operation result of the value function b (K) as the name of a first-level directory;
s2, acquiring the current date Y, and calculating a value function b (Y) of the current date Y:
b(Y)=Y mod M
using the operation result as the name of the secondary directory;
s3, acquiring a file step length variable value n set by the system;
s4, acquiring the file name Z of the uploaded file, and calculating a value function P (Z):
s5, mixing the P (Z) value obtained in S4 with 2n-1 bitwise and operation to obtain the name of the tertiary directory;
and S6, respectively storing the user name, the date and the file name in corresponding directories.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911323288.5A CN111078650B (en) | 2019-12-20 | 2019-12-20 | File storage method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911323288.5A CN111078650B (en) | 2019-12-20 | 2019-12-20 | File storage method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111078650A true CN111078650A (en) | 2020-04-28 |
CN111078650B CN111078650B (en) | 2023-07-25 |
Family
ID=70316145
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911323288.5A Active CN111078650B (en) | 2019-12-20 | 2019-12-20 | File storage method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111078650B (en) |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070083491A1 (en) * | 2004-05-27 | 2007-04-12 | Silverbrook Research Pty Ltd | Storage of key in non-volatile memory |
CN102779166A (en) * | 2012-06-21 | 2012-11-14 | 宁波波导股份有限公司 | Method for storing mass data |
CN102904931A (en) * | 2012-09-19 | 2013-01-30 | 河南锐之旗信息技术有限公司 | Method for storing and reading picture |
CN103970842A (en) * | 2014-04-24 | 2014-08-06 | 河海大学 | Water conservancy big data access system and method for field of flood control and disaster reduction |
CN105354510A (en) * | 2015-10-28 | 2016-02-24 | 广东欧珀移动通信有限公司 | Photo naming method and naming system |
CN106155592A (en) * | 2016-07-26 | 2016-11-23 | 深圳天珑无线科技有限公司 | A kind of photo processing method and terminal |
CN107943807A (en) * | 2016-10-13 | 2018-04-20 | 华为技术有限公司 | A kind of data processing method and storage device |
CN108763413A (en) * | 2018-05-23 | 2018-11-06 | 唐山高新技术产业园区兴荣科技有限公司 | Data memory format and its data search localization method |
CN109033238A (en) * | 2018-07-04 | 2018-12-18 | 北京星球时空科技有限公司 | Data production, tissue, storage and the access method of electronic map collecting system |
-
2019
- 2019-12-20 CN CN201911323288.5A patent/CN111078650B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070083491A1 (en) * | 2004-05-27 | 2007-04-12 | Silverbrook Research Pty Ltd | Storage of key in non-volatile memory |
CN102779166A (en) * | 2012-06-21 | 2012-11-14 | 宁波波导股份有限公司 | Method for storing mass data |
CN102904931A (en) * | 2012-09-19 | 2013-01-30 | 河南锐之旗信息技术有限公司 | Method for storing and reading picture |
CN103970842A (en) * | 2014-04-24 | 2014-08-06 | 河海大学 | Water conservancy big data access system and method for field of flood control and disaster reduction |
CN105354510A (en) * | 2015-10-28 | 2016-02-24 | 广东欧珀移动通信有限公司 | Photo naming method and naming system |
CN106155592A (en) * | 2016-07-26 | 2016-11-23 | 深圳天珑无线科技有限公司 | A kind of photo processing method and terminal |
CN107943807A (en) * | 2016-10-13 | 2018-04-20 | 华为技术有限公司 | A kind of data processing method and storage device |
CN108763413A (en) * | 2018-05-23 | 2018-11-06 | 唐山高新技术产业园区兴荣科技有限公司 | Data memory format and its data search localization method |
CN109033238A (en) * | 2018-07-04 | 2018-12-18 | 北京星球时空科技有限公司 | Data production, tissue, storage and the access method of electronic map collecting system |
Non-Patent Citations (2)
Title |
---|
吴加强: "巧用Excel函数轻松批量重命名", 《电脑知识与技术(经验技巧)》, no. 02, pages 40 - 41 * |
王昌红: "轻松批量处理图片文件", 《电脑知识与技术(经验技巧)》, no. 05, pages 19 * |
Also Published As
Publication number | Publication date |
---|---|
CN111078650B (en) | 2023-07-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104572670B (en) | A kind of storage of small documents, inquiry and delet method and system | |
CN108205577B (en) | Array construction method, array query method, device and electronic equipment | |
JP5661104B2 (en) | Method and system for search using search engine indexing and index | |
CN102024047B (en) | Data searching method and device thereof | |
CN103282899B (en) | The storage method of data, access method and device in file system | |
CN102893265B (en) | Management can independent access data cell storage | |
CN109284273B (en) | Massive small file query method and system adopting suffix array index | |
CN107045531A (en) | A kind of system and method for optimization HDFS small documents access | |
US8572110B2 (en) | Textual search for numerical properties | |
CN105912636B (en) | Map/Reduce-based ETL data processing method and device | |
CN103500196A (en) | EXCEL data export method and export device in multi-concurrence large data volume environment | |
CN100571317C (en) | A kind of calling list rearrangement method and device | |
CN104462141A (en) | Data storage and query method and system and storage engine device | |
CN106682148A (en) | Method and device based on Solr data search | |
EP3788505B1 (en) | Storing data items and identifying stored data items | |
CN103685589A (en) | Binary coding-based domain name system (DNS) data compression and decompression methods and systems | |
CN101252756B (en) | Method for leading in and out address book information of mobile terminal | |
WO2017036348A1 (en) | Method and device for compressing and decompressing extensible markup language document | |
JP4233564B2 (en) | Data processing apparatus, data processing program and recording medium | |
CN102486772A (en) | Method and device for exporting data | |
CN101393551B (en) | Index establishing system and method for patent full text search | |
CN111352960B (en) | Express order information query method, device, equipment and storage medium | |
CN111078650A (en) | File storage method | |
JPWO2020015613A5 (en) | ||
CN108874891B (en) | Method for facilitating reading of family cloud disk files |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |