CN109284252B - Lightweight file system management method in communication equipment - Google Patents
Lightweight file system management method in communication equipment Download PDFInfo
- Publication number
- CN109284252B CN109284252B CN201811055384.1A CN201811055384A CN109284252B CN 109284252 B CN109284252 B CN 109284252B CN 201811055384 A CN201811055384 A CN 201811055384A CN 109284252 B CN109284252 B CN 109284252B
- Authority
- CN
- China
- Prior art keywords
- file
- header information
- name
- retrieval
- mapping information
- 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
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention provides a lightweight file system management method in communication equipment, which comprises a file storage process, a file retrieval process and a file operation process, wherein in the file storage process, file header information and file data are separately stored in system storage equipment, the file header information content comprises file mapping information, file size, a file offset pointer and a space use identifier, and a file system comprises a file mapping information table; the file retrieval process comprises the steps of carrying out sectional retrieval on file header information according to file names and judging whether the file header information is used or not through space use identification; the file operation process comprises the steps of obtaining a terminal file name, carrying out file retrieval on the file name, matching file header information corresponding to the file name, and directly operating a file data physical storage address. The invention can directly read and write the physical address of the file data only by searching the file header information, thereby reducing the file searching speed and improving the file operating efficiency.
Description
Technical Field
The invention relates to the field of communication systems, in particular to a lightweight file system management method in communication equipment.
Background
The file system is a method for organizing files on the storage device, and transplanting the traditional file system in the application of the actual embedded system needs to occupy a large amount of memory resources, and the size of the file system also occupies a large storage space of the device, so that certain requirements are imposed on the storage capacity of the embedded operating system. The size and storage capacity of the main stream microprocessing memory in the market are very limited, and the transplantation of the main stream file system needs to occupy precious memory resources. Therefore, the conventional file system cannot meet the file management requirement under a low-cost, small-capacity and low-power-consumption platform, especially in the field of communication, the miniaturization of the device is an important development direction at present, and the file management requirement in the communication device is more urgent. For the special requirements of low-cost embedded systems, it is necessary to provide a file system management solution that is sufficiently lightweight. The invention provides a lightweight file management solution, which is suitable for a simple operating system platform or an embedded equipment platform without an operating system, supports a basic file operation method in a mainstream file system, and solves the problem of basic file operation under a low-cost, small-capacity and low-power-consumption platform.
Disclosure of Invention
The invention aims to provide a simple and efficient embedded file management and file transmission method supporting multiple file transmission modes, so that the basic operation problem of files under a communication equipment platform with low cost, small capacity and low power consumption is solved.
The technical scheme of the invention provides a lightweight file system management method in communication equipment, which comprises a file storage process, a file retrieval process and a file operation process,
the file storage procedure is implemented as follows,
the file header information and the file data are separately stored in a system storage device in a mode of sequentially storing in a physical storage space of the device by taking a block as a unit;
the file header information content comprises file mapping information, file size, a file offset pointer and a space use identifier, wherein the file mapping information comprises a file name and a file physical storage address, and the space use identifier indicates whether a mapping file exists in the current file header information or not;
the file system comprises a file mapping information table, and all file mapping relations which are supported by the file system to the maximum extent are stored in the file mapping information table; the file system only operates the files existing in the file mapping information table, the files which do not exist in the file mapping information table are determined as illegal files, and each file in the file mapping information table has a fixed physical storage address and a fixed file name;
the file retrieval process comprises the steps of carrying out sectional retrieval on file header information according to file names and judging whether the file header information is used or not through space use identification;
the file operation process comprises the steps of acquiring a terminal file name, carrying out file retrieval on the file name, and matching file header information corresponding to the file name; and if the system supports the file, acquiring a physical storage address and a file offset pointer of the file data, and directly operating the physical storage address of the file data.
Moreover, the use of the space use identifier "1" indicates that the file mapping information exists in the current header information, and "0" indicates that the file mapping information does not exist in the current header information.
Further, the document retrieval process includes the steps of:
(1) acquiring the first letter of the required file name, matching the first letter of the file header information segment, searching the file header information segment corresponding to the first letter, if the matching is successful, entering the step (2), otherwise, determining that the file name is an invalid file name, and ending the process;
(2) judging space use marks in each file header information in the file header information section, matching the file name with the file header information with the space use mark of '1', and performing the step (4) if the corresponding file header information is matched; otherwise, performing the step (3);
(3) searching a file mapping information table, matching the file name with the file name in the file mapping information table, and judging whether the file is a system support file; if the file is supported by the system, searching for the idle file header information with the space use identifier of '0', and storing the file mapping information into the area with the space use identifier of '0' in the corresponding file header information; if the file is a non-system support file, no operation is performed, and the process is ended;
(4) and obtaining the file size, the file offset pointer and the file mapping information according to the file header information, and obtaining the physical storage address of the file data through the file mapping information to finish file retrieval.
Moreover, the file operation process includes the following steps:
(1) acquiring a terminal file operation command, performing command operation code matching on the file operation command and a file operation command set, if the matching is successful, entering (2), otherwise, determining that the command is an invalid command, and ending the process;
(2) analyzing and extracting a file operation function corresponding to the successfully matched command operation code;
(3) acquiring a terminal file name, performing file retrieval on the file name, and matching file header information corresponding to the file name;
if the file is supported by the system, acquiring a physical storage address and a file offset pointer of file data;
if the file is a non-system-supported file, judging that the file name is wrong, and ending the process;
(4) and according to the file data physical address and the file offset pointer, the file operation function directly calls a bottom layer driving function of the storage equipment to directly write, read or erase the file data physical storage address.
Furthermore, the file header information is stored in segments at the start address of the physical storage device, and the file data is stored after the file header information.
Moreover, the file header information storage form adopts a structural body mode.
The file system management method adopted by the invention stores the file header information and the file data separately, and only the file header information needs to be searched when the file is searched in a way of mapping the file name and the physical storage address of the fixed file data one by one through the file header information. Compared with the traditional linked list type file system, the code efficiency is improved, the code quantity required by the file system is reduced, and the requirement of the file system on the storage capacity of the internal codes of the embedded system is reduced. In the file retrieval process, the method for carrying out sectional retrieval on the file header information through the file name reduces the logic complexity of a file system, can directly read and write the physical address of the file data only by retrieving the file header information, improves the file retrieval efficiency, and reduces the influence of the file retrieval on the system performance. The invention also provides a file operation command set which has the same operation habit as the Linux file, and is convenient for a file system to use. The invention relates to a lightweight file system management method suitable for a low-cost and small-capacity embedded system.
Drawings
FIG. 1 is a block diagram of a file storage structure in a storage device provided in an embodiment of the present invention;
FIG. 2 is a flow chart for providing segmented document retrieval according to an embodiment of the present invention;
FIG. 3 is a flowchart of a file operation method provided in an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the technical solution of the present invention, the following detailed description of the present invention is provided in conjunction with the accompanying drawings and examples.
The lightweight file system management method in the communication equipment mainly comprises three aspects of file storage, file retrieval and file operation.
The file is an information set stored on a computer, and the file in the management method of the file system consists of file header information and file data. The file header and the file data are stored in the system storage device separately, and the storage mode is that the file header and the file data are sequentially stored in a physical storage space of the device by taking a block as a unit.
Referring to fig. 1, in the embodiment of the present invention, header information and file data are sequentially stored in different sections in a storage space of a device in units of blocks, respectively, and the file includes a file 1, a file 2, a file 3, and a file 4 …, where the file header information segment a includes a file header information 1, a file header information segment 2, and a file header information segment 3 …, and the file header information segment C … is stored sequentially
In the embodiment, the file header information is stored from the start address of the physical storage device in a form of a structure. The file header information is stored in the initial address of the physical storage device in a segmented manner according to the file name in an initial ordering manner, wherein the file header information comprises four contents of file mapping information, a file size, a file offset pointer and a space use identifier, the file mapping information comprises the file name and a file physical storage address, the file offset pointer represents the offset of a current file read-write pointer relative to the file initial address, and the space use identifier represents whether the current file header information contains the file mapping information. In the embodiment, the space usage identifier "1" is used to indicate that the file mapping information exists in the current header information, and "0" indicates that the file mapping information does not exist in the current header information.
The file system comprises a file mapping information table, all file mapping information which is supported by the file system to the maximum extent is stored in the file mapping information table, and a fixed physical storage address and a fixed file name are mapped in a one-to-one manner; the file mapping information table in the file system is written at the time of file system creation and exists inside the system program. The file system operates only on the files existing in the file mapping information table, and recognizes the files not existing in the file mapping information table as illegal files. Each file in the file mapping information table has a fixed physical storage address and a fixed file name.
The mapping relation between all file names and file physical storage addresses is stored in the file mapping table, and the file mapping information in the file header information only stores the mapping information between the file names and the file physical storage addresses in the current file.
The file header information is stored in the initial address of the physical storage device in a segmented manner, and the file data is stored behind the file header information. The file data part only stores the file contents, and the file data of different files are distinguished by physical storage addresses. Compared with the file header information in the traditional file system which is stored separately, the file header information in the invention is uniformly stored in the initial address position of the memory, so that the file header information can be better searched in a sectional mode, and the file searching speed can be improved. Compared with the tree-shaped storage structure of the traditional file system, the resource consumption in file storage is reduced through the mapping relation between the physical address of the fixed file data and the fixed file name, the influence on the system performance in the working process of the file system is reduced, and the requirements of a low-cost and small-capacity embedded system are met.
After the file data are sequentially stored in the file header information according to the file mapping information table, each file data has a fixed initial address, and the space size of the file data distribution can be reasonably configured in units of blocks according to the actual file size.
The file retrieval is to perform sectional retrieval according to the first letter of the file name, judge whether the file header information is used or not through the space use identifier, improve the efficiency of the file retrieval and reduce the time of the file retrieval. Referring to fig. 2, an embodiment file retrieval process is as follows:
(1) obtaining the first letter of the required file name, matching the first letter of the file header information segment, and searching the file header information segment corresponding to the first letter according to the matched first letter of the file, for example: the file with the file name of "hello.cfg" is matched with the file header information segment H; and (2) if the matching is successful, otherwise, determining that the file name is invalid, and ending the process.
(2) And judging the space use identifier in each file header information in the file header information section, and matching the file name with the file header information with the space use identifier of '1'. If the corresponding file header information is matched, the complete file name is successfully matched, namely the file exists, and the step (4) can be directly carried out; and (4) if the corresponding file header information is not found after the file header information is matched with all the space use marks of 1, performing the step (3).
(3) And searching a file mapping information table, matching the file name with the file name in the file mapping information table, and judging whether the file is a system support file. If the file is supported by the system, searching the free file header information with the space use identifier of '0', and storing the file mapping information into the area with the space use identifier of '0' in the corresponding file header information. If the file is a non-system-supported file, no operation is performed, and the file name can be determined to be an invalid file name, and the process is ended.
If the file name is not matched with the file header information, the file name can be matched in the file mapping information table, which indicates that the file does not exist at present, and the file can be newly created. If the file name does not match the corresponding information in the file mapping information table, it indicates a non-system-supported file.
(4) And obtaining the file size, the file offset pointer and the file mapping information according to the file header information, and obtaining the physical storage address of the file data through the file mapping information to finish file retrieval.
In order to facilitate the use of the file system and match with the use habit of a common file system, the command name used by the file operation command in the invention is consistent with the name of the read-write file operation command in Linux. Referring to fig. 3, the process of reading and writing files by the file system in the embodiment is as follows:
(1) acquiring a terminal file operation command, performing command operation code matching on the file operation command and a file operation command set, if the matching is successful, entering (2), otherwise, determining that the command is an invalid command, and ending the process;
(2) analyzing and extracting a file operation function corresponding to the successfully matched command operation code;
(3) and acquiring a terminal file name, performing file retrieval on the file name, and matching file header information corresponding to the file name. If the file is supported by the system, acquiring a physical storage address and a file offset pointer of file data; if the file is a non-system-supported file, judging that the file name is wrong, and ending the process;
(4) and directly writing, reading and erasing the physical storage address of the file data by directly calling a bottom drive function of the storage equipment by the file operation function according to the physical address of the file data and the file offset pointer.
In specific implementation, the automatic operation of the above processes can be realized by adopting a software mode.
The principles and embodiments of the present invention are explained herein using specific examples, which are presented only to assist in understanding the method and its core concepts. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.
Claims (4)
1. A management method of a lightweight file system in communication equipment is characterized in that: the method is used for basic file operation under a low-cost, small-capacity and low-power-consumption communication equipment platform, file header information and file data are stored separately, the file name and the fixed file data physical storage address are mapped one by one through the file header information, only the file header information needs to be retrieved when a file is retrieved, and the file header information is retrieved in a sectional type manner through the file name, so that the logic complexity of a file system is reduced, the file data physical address can be directly read and written only by retrieving the file header information, the file retrieval efficiency is improved, and the influence of the file retrieval on the system performance is reduced; the implementation process comprises a file storage process, a file retrieval process and a file operation process,
the file storage procedure is implemented as follows,
the file header information and the file data are separately stored in a system storage device in a mode of sequentially storing in a physical storage space of the device by taking a block as a unit;
the file header information content comprises file mapping information, file size, a file offset pointer and a space use identifier, wherein the file mapping information comprises a file name and a file physical storage address, and the space use identifier indicates whether a mapping file exists in the current file header information or not;
the file system comprises a file mapping information table, and all file mapping relations which are supported by the file system to the maximum extent are stored in the file mapping information table; the file system only operates the files existing in the file mapping information table, the files which do not exist in the file mapping information table are determined as illegal files, and each file in the file mapping information table has a fixed physical storage address and a fixed file name;
the file retrieval process comprises the steps of carrying out sectional retrieval on file header information according to file names and judging whether the file header information is used or not through space use identification;
the file retrieval process, comprising the steps of,
(1) acquiring the first letter of the required file name, matching the first letter of the file header information segment, searching the file header information segment corresponding to the first letter, if the matching is successful, entering the step (2), otherwise, determining that the file name is an invalid file name, and ending the process;
(2) judging space use marks in each file header information in the file header information section, matching the file name with the file header information with the space use mark of '1', and performing the step (4) if the corresponding file header information is matched; otherwise, performing the step (3);
(3) searching a file mapping information table, matching the file name with the file name in the file mapping information table, and judging whether the file is a system support file; if the file is supported by the system, searching for the idle file header information with the space use identifier of '0', and storing the file mapping information into the area with the space use identifier of '0' in the corresponding file header information; if the file is a non-system support file, no operation is performed, and the process is ended;
(4) obtaining the file size, the file offset pointer and the file mapping information according to the file header information, obtaining a physical storage address of file data through the file mapping information, and completing file retrieval;
the file operation process comprises the steps of acquiring a terminal file name, carrying out file retrieval on the file name, and matching file header information corresponding to the file name; if the file is supported by the system, acquiring a physical storage address and a file offset pointer of the file data, and directly operating the physical storage address of the file data;
the file operating process comprises the following steps,
(1) acquiring a terminal file operation command, performing command operation code matching on the file operation command and a file operation command set, if the matching is successful, entering (2), otherwise, determining that the command is an invalid command, and ending the process;
(2) analyzing and extracting a file operation function corresponding to the successfully matched command operation code;
(3) acquiring a terminal file name, performing file retrieval on the file name, and matching file header information corresponding to the file name;
if the file is supported by the system, acquiring a physical storage address and a file offset pointer of file data;
if the file is a non-system-supported file, judging that the file name is wrong, and ending the process;
(4) and according to the file data physical address and the file offset pointer, the file operation function directly calls a bottom layer driving function of the storage equipment to directly write, read or erase the file data physical storage address.
2. A method for lightweight file system management in a communication device as claimed in claim 1, characterized by: the space use identifier is 1 to indicate that the file mapping information exists in the current file header information, and 0 indicates that the file mapping information does not exist in the current file header information.
3. A method for lightweight file system management in a communication device according to claim 1 or 2, characterized by: the file header information is stored in segments at the starting address of the physical storage device, and the file data is stored behind the file header information.
4. A method for lightweight file system management in a communication device according to claim 1 or 2, characterized by: the file header information storage form adopts a structural body mode.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811055384.1A CN109284252B (en) | 2018-09-11 | 2018-09-11 | Lightweight file system management method in communication equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811055384.1A CN109284252B (en) | 2018-09-11 | 2018-09-11 | Lightweight file system management method in communication equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109284252A CN109284252A (en) | 2019-01-29 |
CN109284252B true CN109284252B (en) | 2021-07-06 |
Family
ID=65178346
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811055384.1A Active CN109284252B (en) | 2018-09-11 | 2018-09-11 | Lightweight file system management method in communication equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109284252B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109977121B (en) * | 2019-03-27 | 2022-10-14 | 上海鸣鸾互联网科技有限公司 | Big data rapid storage system |
CN110597463A (en) * | 2019-08-16 | 2019-12-20 | 深圳中兴网信科技有限公司 | Data reading and writing method, computer equipment and computer readable storage medium |
CN110851403A (en) * | 2019-10-24 | 2020-02-28 | 北京空间飞行器总体设计部 | Satellite-borne file management method based on ROM and RAM |
CN111125019A (en) * | 2019-12-20 | 2020-05-08 | 北京无线电测量研究所 | File retrieval method, writing method, system, FPGA chip and device |
CN111711687B (en) * | 2020-06-15 | 2023-03-24 | 肖伟峰 | File data transmission and storage method |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5463772A (en) * | 1993-04-23 | 1995-10-31 | Hewlett-Packard Company | Transparent peripheral file systems with on-board compression, decompression, and space management |
CN1702638A (en) * | 2005-06-08 | 2005-11-30 | 武汉虹信通信技术有限责任公司 | Method for improving serial data handling capacity of embedded systems |
CN102902709A (en) * | 2012-08-02 | 2013-01-30 | 何建亿 | Space allocation fixing file memory system and implementation method |
CN104346357A (en) * | 2013-07-29 | 2015-02-11 | 中国科学院声学研究所 | File accessing method and system for embedded terminal |
CN108021717A (en) * | 2017-12-29 | 2018-05-11 | 成都三零嘉微电子有限公司 | A kind of implementation method of lightweight embedded file system |
CN108491402A (en) * | 2018-01-17 | 2018-09-04 | 艾体威尔电子技术(北京)有限公司 | A kind of implementation method of lightweight file system |
CN109977121A (en) * | 2019-03-27 | 2019-07-05 | 上海鸣鸾互联网科技有限公司 | A kind of big data quick storage system |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TWI241501B (en) * | 2003-12-05 | 2005-10-11 | Mediatek Inc | Electronic device and file searching method thereof |
CN101763394B (en) * | 2009-12-31 | 2012-06-06 | 傅如毅 | Method for searching secret-related files in computer system |
CN104915425B (en) * | 2015-06-12 | 2018-08-17 | 北京北信源软件股份有限公司 | A kind of search method and device of file content |
-
2018
- 2018-09-11 CN CN201811055384.1A patent/CN109284252B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5463772A (en) * | 1993-04-23 | 1995-10-31 | Hewlett-Packard Company | Transparent peripheral file systems with on-board compression, decompression, and space management |
CN1702638A (en) * | 2005-06-08 | 2005-11-30 | 武汉虹信通信技术有限责任公司 | Method for improving serial data handling capacity of embedded systems |
CN102902709A (en) * | 2012-08-02 | 2013-01-30 | 何建亿 | Space allocation fixing file memory system and implementation method |
CN104346357A (en) * | 2013-07-29 | 2015-02-11 | 中国科学院声学研究所 | File accessing method and system for embedded terminal |
CN108021717A (en) * | 2017-12-29 | 2018-05-11 | 成都三零嘉微电子有限公司 | A kind of implementation method of lightweight embedded file system |
CN108491402A (en) * | 2018-01-17 | 2018-09-04 | 艾体威尔电子技术(北京)有限公司 | A kind of implementation method of lightweight file system |
CN109977121A (en) * | 2019-03-27 | 2019-07-05 | 上海鸣鸾互联网科技有限公司 | A kind of big data quick storage system |
Non-Patent Citations (1)
Title |
---|
单固态硬盘嵌入式系统的数据存储可信性研究;黄伟林;《中国优秀硕士学位论文全文数据库 信息科技辑》;20180615(第 06 期);I137-71 * |
Also Published As
Publication number | Publication date |
---|---|
CN109284252A (en) | 2019-01-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109284252B (en) | Lightweight file system management method in communication equipment | |
US7515500B2 (en) | Memory device performance enhancement through pre-erase mechanism | |
CN100561386C (en) | A data storage method and device | |
CN105740163A (en) | Nand Flash bad block management method | |
CN112231244B (en) | SIM card file erasing and writing system and method applied to SoftSIM and readable storage medium | |
KR20080086828A (en) | Memory management apparatus and method, and memory management system | |
CN102103596B (en) | method for implementing file system in embedded system | |
CN102223410A (en) | Searching method of intelligent information terminal and terminal | |
CN106383666B (en) | Data storage method and device | |
CN101582084B (en) | Method and device for data storage | |
CN100458736C (en) | NAND flash information extraction method and NAND flash automatic identification method | |
CN112463020A (en) | Data access method, device and equipment based on Flash | |
CN109840218A (en) | Effective data management method and storage control | |
CN109597580B (en) | Flash operation method suitable for intelligent electric meter load curve storage | |
CN103136215A (en) | Data read-write method and device of storage system | |
CN101452422A (en) | Chip data read-write method, corresponding apparatus and system | |
CN108664577B (en) | A file management method and system based on FLASH free area | |
CN101777077B (en) | Method for implementing file system of embedded device | |
CN101131649A (en) | Updating speed improving method for read-only memory of device with flash memory | |
CN201707662U (en) | Embedded type equipment supporting JAVA technology | |
CN112596949A (en) | High-efficiency SSD (solid State disk) deleted data recovery method and system | |
CN109086001B (en) | NAND Flash garbage recovery method and system | |
CN117473117A (en) | Video cyclic storage method, system and computer | |
CN1687899A (en) | Method, system and module for dynamic downloading of applied programe to user identification | |
CN111142804A (en) | Management system for computer storage equipment |
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 | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20201030 Address after: 430205 No.1 tanhu 2nd Road, Canglong Island, Jiangxia Economic Development Zone, Wuhan City, Hubei Province Applicant after: Wuhan Hongxin Technology Development Co.,Ltd. Address before: 430073 Hubei province Wuhan Dongxin East Lake high tech Development Zone, Road No. 5 Applicant before: Wuhan Hongxin Telecommunication Technologies Co.,Ltd. |
|
TA01 | Transfer of patent application right | ||
GR01 | Patent grant | ||
GR01 | Patent grant |