CN111078650B - File storage method - Google Patents
File storage method Download PDFInfo
- Publication number
- CN111078650B CN111078650B CN201911323288.5A CN201911323288A CN111078650B CN 111078650 B CN111078650 B CN 111078650B CN 201911323288 A CN201911323288 A CN 201911323288A CN 111078650 B CN111078650 B CN 111078650B
- Authority
- CN
- China
- Prior art keywords
- file
- name
- acquiring
- function
- 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.)
- Active
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, acquiring an operation user name K of a current uploading file, and defining a value function b (K) of the operation user name K: b (K) =k mod M; taking the operation result of the value function b (K) as the name of the primary directory; s2, acquiring the current year and month Y, and calculating a value function b (Y) of the current year and month Y: b (Y) =y mod M, and the operation result is taken as the name of the secondary directory; s3, acquiring a file step variable value n set by a system; s4, acquiring a 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 2 n 1, performing bitwise AND operation to obtain the name of the three-level catalogue; s6, storing the file under the corresponding catalogue. The invention stores the user name, date and file name in the three-level catalogue respectively, can solve the problem that too many files are in the same folder when the files are uploaded and stored in the B/S architecture, can search the files in various modes, and improves the reading efficiency and 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 B/S architecture model, the end user creates a folder on a server (typically a file server) by user action and then saves the file under the folder when saving the file.
Along with the increase of the service time of the system or the frequent file operation of a user, excessive files under a certain folder can finally appear, 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 store a user name, a date and a file name in a three-level directory respectively, search files in various modes and improve the reading efficiency and performance of the files.
The aim of the invention is realized by the following technical scheme: a method of storing a file, comprising the steps of:
s1, acquiring an operation user name K of a current uploading 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 any prime number;
taking the operation result of the value function b (K) as the name of the primary directory;
s2, acquiring the current date Y, and calculating a valued function b (Y) of the current date Y:
b(Y)=Y mod M
the operation result is used as the name of the secondary catalog;
s3, acquiring a file step variable value n set by a system;
s4, acquiring a file name Z of the uploaded file, and calculating a value function P (Z) of the file name Z:
wherein W is the size of the computer word,f function is a rounding function;
s5, mixing the P (Z) value obtained in S4 with 2 n 1, carrying out bitwise AND operation according to the bits to obtain the names of the three-level catalogs;
and S6, storing the user name, the date and the file name under the corresponding catalogs respectively.
The beneficial effects of the invention are as follows: the invention stores the user name, date and file name in the three-level catalogue respectively, can solve the problem that too many files are in the same folder when the files are uploaded and stored in the B/S architecture, can search the files in various modes, and improves the reading efficiency and performance of the files.
Detailed Description
The technical scheme of the invention is further described below.
The invention discloses a file storage method, which comprises the following steps:
s1, acquiring an operation user name K of a current uploading 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 any prime number;
taking the operation result of the value function b (K) as the name of the primary directory;
s2, acquiring the current date Y (generally adopting a year and month format yyyy-MM, for example 2109-12), and calculating a value function b (Y):
b(Y)=Y mod M
the operation result is used as the name of the secondary catalog;
s3, acquiring a file step variable value n set by a system;
s4, acquiring a file name Z of the uploaded file, wherein the file name Z comprises a suffix name such as (example. Zip); calculating a valued function P (Z):
wherein W is the size of the computer word,f function is a rounding function;
s5, carrying out bit-wise AND operation on the P (Z) value obtained in the S4 and 2n-1 (converting the obtained value into a 2-system number, then carrying out bit-wise AND operation) to obtain the name of the three-level directory;
s6, finally, the files are evenly distributed into three-level catalogues, and the maximum number of the three-level catalogues is (2 n -1) the uploaded original file is directly saved in a tertiary directory, and then the user name, date and file name are saved under the corresponding directory, respectively.
Those of ordinary skill in the art will recognize that the embodiments described herein are for the purpose of aiding the reader in understanding the principles of the present invention and should be understood that the scope of the invention is not limited to such specific statements and embodiments. Those of ordinary skill in the art can make various other specific modifications and combinations from the teachings of the present disclosure without departing from the spirit thereof, and such modifications and combinations remain within the scope of the present disclosure.
Claims (1)
1. A method of storing a file, comprising the steps of:
s1, acquiring an operation user name K of a current uploading 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 any prime number;
taking the operation result of the value function b (K) as the name of the primary directory;
s2, acquiring the current date Y, and calculating a valued function b (Y) of the current date Y:
b(Y)=Y mod M
the operation result is used as the name of the secondary catalog;
s3, acquiring a file step variable value n set by a system;
s4, acquiring a file name Z of the uploaded file, and calculating a value function P (Z) of the file name Z:
wherein W is the size of the computer word,f function is a rounding function;
s5, mixing the P (Z) value obtained in S4 with 2 n 1, carrying out bitwise AND operation according to the bits to obtain the names of the three-level catalogs;
and S6, storing the user name, the date and the file name under the corresponding catalogs respectively.
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 CN111078650A (en) | 2020-04-28 |
CN111078650B true 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 (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102779166A (en) * | 2012-06-21 | 2012-11-14 | 宁波波导股份有限公司 | Method for storing mass data |
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 |
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 |
Family Cites Families (4)
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 |
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 |
CN107943807B (en) * | 2016-10-13 | 2020-06-16 | 华为技术有限公司 | Data processing method and storage device |
-
2019
- 2019-12-20 CN CN201911323288.5A patent/CN111078650B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102779166A (en) * | 2012-06-21 | 2012-11-14 | 宁波波导股份有限公司 | Method for storing mass data |
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 |
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函数轻松批量重命名;吴加强;《电脑知识与技术(经验技巧)》(第02期);40-41 * |
轻松批量处理图片文件;王昌红;《电脑知识与技术(经验技巧)》(第05期);19 * |
Also Published As
Publication number | Publication date |
---|---|
CN111078650A (en) | 2020-04-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108205577B (en) | Array construction method, array query method, device and electronic equipment | |
CN102024047B (en) | Data searching method and device thereof | |
JP5661104B2 (en) | Method and system for search using search engine indexing and index | |
CN103020281B (en) | A kind of data storage and retrieval method based on spatial data numerical index | |
US11126591B2 (en) | Filter file system with inode number as primary database key | |
US20100082545A1 (en) | Compression of sorted value indexes using common prefixes | |
CN103778202A (en) | Enterprise electronic document managing server side and system | |
CN105912636B (en) | Map/Reduce-based ETL data processing method and device | |
CN111078701B (en) | Data extraction method and device based on relational database | |
CN109284273B (en) | Massive small file query method and system adopting suffix array index | |
CN101252756B (en) | Method for leading in and out address book information of mobile terminal | |
CN103685589A (en) | Binary coding-based domain name system (DNS) data compression and decompression methods and systems | |
CN106682148A (en) | Method and device based on Solr data search | |
CN102622434A (en) | Data storage method, data searching method and device | |
CN112214472B (en) | Meteorological lattice data storage and query method, device and storage medium | |
CN116450656B (en) | Data processing method, device, equipment and storage medium | |
WO2020215689A1 (en) | Query method and apparatus for column-oriented files | |
CN111078650B (en) | File storage method | |
CN101145155A (en) | Electronic dictionary data memory format and its searching method | |
CN111352960B (en) | Express order information query method, device, equipment and storage medium | |
CN112181302A (en) | Data multilevel storage and access method and system | |
CN101014059A (en) | Method for storing and extending data information of electric phone book | |
US20150160921A1 (en) | Parallel Sorting Key Generation | |
CN113342813B (en) | Key value data processing method, device, computer equipment and readable storage medium | |
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 |