CN114691533B - Wear balancing method for file storage medium, storage medium and breathing machine - Google Patents

Wear balancing method for file storage medium, storage medium and breathing machine Download PDF

Info

Publication number
CN114691533B
CN114691533B CN202011642115.2A CN202011642115A CN114691533B CN 114691533 B CN114691533 B CN 114691533B CN 202011642115 A CN202011642115 A CN 202011642115A CN 114691533 B CN114691533 B CN 114691533B
Authority
CN
China
Prior art keywords
file
sectors
storage medium
working
log buffer
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
Application number
CN202011642115.2A
Other languages
Chinese (zh)
Other versions
CN114691533A (en
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.)
Resvent Medical Technology Co Ltd
Original Assignee
Resvent Medical 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 Resvent Medical Technology Co Ltd filed Critical Resvent Medical Technology Co Ltd
Priority to CN202011642115.2A priority Critical patent/CN114691533B/en
Publication of CN114691533A publication Critical patent/CN114691533A/en
Application granted granted Critical
Publication of CN114691533B publication Critical patent/CN114691533B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0238Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
    • G06F12/0246Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory in block erasable memory, e.g. flash memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/72Details relating to flash memory management
    • G06F2212/7211Wear leveling
    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE 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/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application provides a wear balance method of a file storage medium, which comprises the steps of dividing a storage area of the Flash storage medium into a log buffer area and a file backup area; when the equipment is in a working state, writing a working file generated by the current work into a plurality of corresponding first sectors in a log buffer; acquiring a plurality of idle second sectors from a file system; generating a mapping table for representing the transfer of the working file from the first sectors occupied by the working file to the second sectors free according to the first sectors occupied by the working file and the second sectors free; writing the mapping table into the SRAM; when the equipment is in a standby state, judging whether a mapping table exists in the SRAM; when the mapping table exists in the SRAM, the working files stored in the log buffer area are transferred to the file backup area according to the mapping table stored in the SRAM. The method can realize the effects of avoiding losing the mapping table when power is off in one-time operation and prolonging the service life of the storage medium.

Description

Wear balancing method for file storage medium, storage medium and breathing machine
Technical Field
The present application relates to a file storage technology, and in particular, to a wear balancing method for a file storage medium, a storage medium, and a ventilator.
Background
During the use process of various devices, working files are continuously generated and are continuously written into the file backup area, so that the FAT table of the file backup area is continuously erased, and the FAT table is a table for describing the distribution state of storage units in a file system and the front-back link relation of file contents (namely, a table for recording the positions of the files). However, the erasing times of the general storage medium are limited, and if the erasing times of the storage positions of the FAT table in the storage medium are too large, the storage medium is damaged, so that the device cannot be used normally.
Taking a breathing machine as an example, some existing solutions are only suitable for small-capacity working files with the same data format, but the working files generated by the breathing machine are generally larger (cross-sector), the formats of the working files are not fixed, and the method is not preferable for large-capacity high-frequency file management, and is difficult to operate, difficult to realize. In other existing solutions, the ventilator will continuously generate working files during ventilation, so that erasing operation is frequently performed on the FAT table of the file system, the erasing operation of the storage medium has a certain service life (the erasing frequency of the Flash storage medium is about 10 ten thousand times), and if the FAT table is damaged, the storage data of the file system is affected; on the other hand, under the condition of ventilation of the device, when the device is abnormally powered down or the device is manually powered down, the file system is easy to damage (similar to a hot plug USB flash disk), and data at the moment can be abnormally lost.
Therefore, the ability to receive large-capacity working files, power-off without losing the mapping table, and minimizing the number of FAT table erasures during a single ventilation operation is a major issue.
Disclosure of Invention
The application provides a wear balancing method of a file storage medium, the storage medium and a breathing machine, which can realize the effects of receiving large-capacity working files in one-time work, preventing a mapping table from being lost when power is off and reducing the erasing times of a FAT table.
In a first aspect, an embodiment of the present application provides a wear balancing method for a file storage medium, where the wear balancing method for the file storage medium includes:
dividing a storage area of a Flash storage medium into a log buffer area and a file backup area, wherein the log buffer area comprises a plurality of first sectors, and the file backup area comprises a plurality of second sectors;
when the equipment is in a working state, writing a working file generated by the current work into a plurality of corresponding first sectors in a log buffer;
acquiring a plurality of idle second sectors from a file system, wherein the file system is a system for managing the file backup area;
generating a mapping table for representing the transfer of the working file from the first sectors occupied by the working file to the second sectors free according to the first sectors occupied by the working file and the second sectors free;
writing the mapping table into the SRAM;
when the equipment is in a standby state, judging whether a mapping table exists in the SRAM;
when the mapping table exists in the SRAM, the working files stored in the log buffer area are transferred to the file backup area according to the mapping table stored in the SRAM.
In a second aspect, an embodiment of the present application provides a storage medium, where program instructions of the above-mentioned wear balancing method of a file storage medium are stored, which can be loaded and executed by a processor.
In a third aspect, an embodiment of the present application provides a ventilator, including:
a memory for storing program instructions of a wear leveling method of the file storage medium;
and the processor is used for executing program instructions to enable the breathing machine to realize the wear balancing method of the file storage medium.
The application adopts a wear balancing method of the file storage medium, the storage medium and the breathing machine, firstly, working files generated in the working process are polled and written to a sector of a log buffer area, and then temporary files stored in the log buffer area are copied and migrated to a file backup area at a proper time, so that direct erasing and writing of a FAT (File Table) in the file backup area are reduced, and the service life of equipment is prolonged. In addition, normally, one working file is insufficient to write all sectors of the log buffer, the working file copy can be migrated to the file backup area in the idle period of the machine after the current working is finished, the log buffer temporarily stores the generated working file until the time when the log buffer is written to and covered next time after being full, and the mapping table stored in the SRAM can prevent the situation that the mapping table is lost under the condition of power failure due to the fact that a standby power supply supplies power when the power is off.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below. It is apparent that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained from the structures shown in these drawings without inventive labor for those skilled in the art.
Fig. 1 is a flowchart of a method for wear leveling of a ventilator file storage medium according to a first embodiment of the present application.
Fig. 2 is a first sub-flowchart of a method for wear leveling of a ventilator file storage medium according to a first embodiment of the present application.
Fig. 3 is a sub-flowchart of a method for wear leveling of a ventilator file storage medium according to a second embodiment of the present application.
Fig. 4 is a sub-flowchart of a method for wear leveling of a ventilator file storage medium according to a third embodiment of the present application.
Fig. 5 is a second sub-flowchart of a method for wear leveling of a ventilator file storage medium according to a first embodiment of the present application.
Fig. 6 is a third sub-flowchart of a method for wear leveling of a ventilator file storage medium according to a first embodiment of the present application.
Fig. 7 is a sub-flowchart of a method for wear leveling of a ventilator file storage medium according to a fourth embodiment of the present application.
Fig. 8 is a schematic view of the internal structure of a ventilator according to the first embodiment of the present application.
Fig. 9 is a schematic diagram of a storage space structure of a Flash storage medium according to a first embodiment of the present application.
Fig. 10 is a schematic diagram of a log buffer sector according to the first embodiment of the present application.
Reference numerals of elements in the drawings
900. Storage 901 of respirator
902. Processor 903 bus
904. Display assembly 905 communication assembly
100 Flash storage medium 101 log buffer
102. First sector of file backup area 1011
The achievement of the objects, functional features and advantages of the present application will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The terms "first," "second," "third," "fourth" and the like in the description and in the claims and in the above drawings, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments described herein may be implemented in other sequences than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be noted that the description of "first", "second", etc. in this disclosure is for descriptive purposes only and is not to be construed as indicating or implying a relative importance or implying an indication of the number of technical features being indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In addition, the technical solutions of the embodiments may be combined with each other, but it is necessary to base that the technical solutions can be realized by those skilled in the art, and when the technical solutions are contradictory or cannot be realized, the combination of the technical solutions should be considered to be absent and not within the scope of protection claimed in the present application.
In the following embodiments, a ventilator is taken as an example to describe the wear balancing method of the file storage medium of the present application, and it is understood that the wear balancing method of the file storage medium and the storage medium of the present application are not limited to use with a ventilator, but can be applied to various types of electronic devices, and the present application is not limited thereto.
Referring to fig. 1 in combination, a flowchart of a method for wear leveling of a storage medium of a ventilator file according to a first embodiment of the present application is shown, where the method for wear leveling of a storage medium of a ventilator file according to the first embodiment specifically includes the following steps.
Step S101, dividing a storage area of a Flash storage medium into a log buffer area and a file backup area. The log buffer area comprises a plurality of first sectors, and the file backup area comprises a plurality of second sectors. Referring to fig. 9 in combination, the storage space of the flash storage medium 100 is divided into a log buffer area 101 and a file backup area 102, wherein the log buffer area 101 includes a plurality of first sectors 1011 and the file backup area includes a plurality of second sectors (not shown). The Flash storage medium is a memory device, and the Flash storage medium is a Non-Volatile (Non-Volatile) memory. Specifically, in the Flash storage medium, most of storage space is allocated to store various working files generated in the ventilation process of the breathing machine, namely a file backup area, and a small part of storage space is used to buffer working files generated in real time, namely a log buffer area, the file backup area is used to truly store working files generated by a machine, the working files are migrated from the log buffer area, and the file backup area is managed by a file system.
Specifically, the file system is a software mechanism responsible for managing and storing file information, and a method for organizing files on a disk or a storage substance is a universal file system module used for realizing the FAT file system in a small embedded system, and the ventilator file management and storage use the system. The file-backup area includes file data (i.e., working files), a directory, and a FAT table.
The file allocation table (File Allocation Table, FAT) is a table describing allocation states of storage units in the file system and a front-back link relationship of file contents (i.e., a table in which positions of files are recorded), and is also called a FAT table. It is an integral part of the file system and is also important for the use of the hard disk, and if the file allocation table is lost or damaged, the data on the hard disk cannot be located and cannot be used. In addition, the read-write operation of the storage area file needs to be performed on the FAT table frequently, that is, the memory area storing the FAT table is frequently erased and written.
Step S102, when the equipment is in a working state, writing the working file generated by the current work into a plurality of corresponding first sectors in the log buffer.
Step S103, obtaining a plurality of idle second sectors from a file system, wherein the file system is a system for managing the file backup area. Specifically, when the ventilator starts to work, the file system divides 8 spaces of the second sector from the file backup area, so that the ventilator stores files generated by one ventilation work. In this embodiment, the file system divides 8 sectors of space from the file backup area. By way of example only, and not limitation. In actual work, the number of second sectors divided by one ventilation work of the file system can be set according to the requirement.
In this embodiment, the storage space of the idle second sectors is larger than the storage space required by the working file generated by one ventilation operation of the device. For example, in general, 6 sector spaces are required for the working files generated by one ventilation operation of the ventilator, and the number of the second sectors divided by the file system is set to be 8, so that the working files generated by one ventilation operation can be stored in the file backup area.
Step S104, a mapping table for representing the transfer of the working file from the first sectors occupied by the working file to the second sectors free is generated according to the first sectors occupied by the working file and the second sectors free. The mapping table comprises a mapping relation and the number of mapping sectors, wherein the mapping relation is a one-to-one correspondence relation between a first sector of a working file stored in the log buffer and a second sector which needs to be migrated to the file backup area. For details, please refer to step S1041-step S1043.
Step S105, writing the mapping table into the SRAM. SRAM is an abbreviation for english static ram, and SRAM is a memory with a static access function, which can store data stored therein without a refresh circuit. The file storage stability is improved.
Step S106, when the device is in a standby state, judging whether a mapping table exists in the SRAM. Specifically, when the ventilator is in a standby state, it is determined whether a mapping table exists in the SRAM.
Step S107, when the mapping table exists in the SRAM, the working file stored in the log buffer is transferred to the file backup area according to the mapping table stored in the SRAM.
For example, 20 working files are generated in one ventilation working process, before a file conversion layer, namely a log buffer area is not added, 20 memory erasing writing operations are needed to be carried out on a FAT table of a file backup area, after the wear balancing processing of the log buffer area is added, only the working files, the FAT table and other data files of the log buffer area are needed to be migrated to the file backup area after ventilation is finished, for a Flash storage medium, the process only needs to carry out 1 memory erasing writing operation, so that the operation times of the FAT table in the file backup area are reduced, and the pressure of memories in other sectors is reduced for a single sector of the log buffer area due to the introduction of the log buffer area, so that the wear balancing processing of the file system is realized. The memory of the log buffer area is not managed by a file system, only the working files generated by ventilation work are temporarily put into the memory, the data loss of the part is not worried about under the condition of power failure, the mapping table for guiding the transfer of the working files is stored in the SRAM in the processor, the ventilator is provided with a standby power supply (which can be implemented as a button battery) for the SRAM, when the main control finds that the ventilator is powered down, the standby power supply is started to supply power for the SRAM, the mapping table stored in the SRAM is ensured not to be lost, and the smooth transfer of the working files is realized.
In the above embodiment, the working files in the ventilation process are firstly written by polling the sectors of the log buffer area, and then the temporary files stored in the log buffer area are transferred to the file backup area in a one-time copy manner at a proper time, so that the direct erasing of the FAT table in the file backup area is reduced, and the service life of the machine is prolonged. In addition, the working files which are usually ventilated once are insufficient to be written into all sectors of the log buffer area, the working files can be copied and migrated to the file backup area in the machine idle period after ventilation is finished, the log buffer area temporarily stores the time from the working files generated in ventilation to the next time when the log buffer area is full and is written into and covered, and the mapping relation stored in the SRAM can prevent the situation that the working files of the breathing machine are lost under the condition of power failure.
Please refer to fig. 2 in combination, which is a flowchart illustrating the substeps of step S102 according to an embodiment of the present application. Step S102, writing the working file generated by the current work into a plurality of corresponding first sectors in the log buffer, specifically comprising the following steps.
In step S1021, the write address in the log buffer is acquired. Referring to fig. 10 in combination, the write address is a sector address where the work file starts writing, for example, the work file starts writing from a memory space with a sector address of 0x00000000. Each first sector has a sector number and its corresponding sector address, for example, sector number 0 corresponds to a sector address of 0x00000000.
Step S1022, writing the working file into the corresponding first sectors sequentially from the writing address. Specifically, the working files are written into the memories of the corresponding sectors in sequence from the memory space of the sector serial number 0.
In this embodiment, the working files to be written into the data backup area are sequentially written into the log buffer sector, and after the log buffer is full, the overwriting starts from sector 0 again, and the working files are sequentially circulated. A large volume of work files may be received. Typically, a data file that is aerated at a time is not sufficient to fill all sectors of the buffer, and a machine idle period after the end of the aeration may migrate a copy of the working file to the file backup area. And when receiving the large-capacity working file, the balance of storage in different areas of the Flash storage medium is balanced, and the utilization rate of the storage medium is improved.
Referring to fig. 3 in combination, a method for wear balancing a file storage medium of a ventilator according to a second embodiment of the present application is provided. The difference between the wear leveling method for a ventilator file storage medium according to the second embodiment and the wear leveling method for a ventilator file storage medium according to the first embodiment is that the following steps are further included before the work file is written into the corresponding plurality of first sectors in sequence from the write address.
In step S301, it is determined whether the log buffer is already full.
In step S302, when the log buffer is full, the working file is overwritten from the first sector of the log buffer. Referring to fig. 10 in combination, when the entire log buffer has been occupied by the working file, the working file is overwritten starting from the first sector with sector number 0.
In this embodiment, the log buffer area stores a plurality of working files in one ventilation operation, and the working files stored in the log buffer area are copied and migrated to the backup area at a time (the data in the log area is reserved until the time covered by the next writing) at one time, so that the erasing and wearing between the log buffer area and the file backup area are balanced.
Referring to fig. 4 in combination, a method for wear balancing a ventilator file storage medium according to a third embodiment of the present application is provided. The difference between the wear balancing method for the file storage medium of the ventilator provided in the third embodiment and the wear balancing method for the file storage medium of the ventilator provided in the first embodiment is that the following steps are further included when the ventilator is in the working state and the standby state.
Step S401, determining whether the device is powered off. In this embodiment, it is determined whether the ventilator is powered down.
In step S402, when the device is powered off, the standby power supply is enabled to supply power to the SRAM. Specifically, when the ventilator is powered down, the backup power supply is enabled to supply power to the SRAM. The backup power source may be a button battery mounted on the ventilator. But may be any other available micro-power supply.
In this embodiment, the main control monitors the power state of the ventilator in real time, so that when the ventilator is powered off due to power failure or other accidents, the power can be timely supplied to the SRAM, the mapping table stored in the SRAM is ensured not to be lost, and therefore the stable operation of the system is ensured.
Please refer to fig. 5 in combination, which is a flowchart illustrating the substeps of step S104 according to an embodiment of the present application. Step S104, generating a mapping table for representing the transfer of the working file from the first sectors occupied by the working file to the second sectors free according to the first sectors occupied by the working file and the second sectors free, and specifically comprising the following steps.
In step S1041, a first number of owned sectors among the first sectors occupied by the working file is calculated. For example, writing 20 working files occupies 5 first sectors.
In step S1042, a first number of second sectors is divided from the free second sectors. For example, 5 second sectors are divided from a number of second sectors free in the file backup area for receiving 20 work files from the 5 first sectors.
In step S1043, a mapping table is generated according to the first number of first sectors and the first number of second sectors. Please refer to step S10431-step S10434.
Please refer to fig. 6 in combination, which is a flowchart of sub-steps of step S1043 according to an embodiment of the present application. Step S1043, generating a mapping table according to the first number of first sectors and the first number of second sectors, specifically includes the following steps.
In step S10431, a first number of first sector IDs in the first number of first sectors is acquired.
In step S10432, a first number of second sector IDs in the first number of second sectors is acquired.
Step S10433, generating a mapping relation according to the first number of first sector IDs and the first number of second sector IDs.
Step S10434, generating a mapping table according to the first number and the mapping relation.
In this embodiment, mapping tables are generated for a number of first sector IDs and a number of second sector IDs to facilitate the log buffer transferring working files to the file backup area.
Referring to fig. 7 in combination, a method for wear balancing a ventilator file storage medium according to a fourth embodiment of the present application is provided. The difference between the wear leveling method for the ventilator file storage medium provided by the fourth embodiment and the wear leveling method for the ventilator file storage medium provided by the first embodiment is that the wear leveling method for the ventilator file storage medium provided by the fourth embodiment further includes the following steps.
Step S701, determining whether all the working files are transferred to the file backup area.
In step S702, when the working files are all transferred to the file backup area, the writing addresses in the log buffer, where the working files can be written, are updated.
In this embodiment, the writing address of the writable working file in the update log buffer area realizes balancing the abrasion relationship among the parts of the Flash storage medium, and prolongs the service life of the Flash storage medium. So that the next ventilation can record the next generated working file and resume working file storage.
In this embodiment, the Flash storage medium is divided into the log buffer area and the file backup area, so that the file generated in real time by the breathing machine is not directly stored in the file backup area managed by the file system, but is cached in the log buffer area, and the like, and then data migration is performed. The storage area of the log buffer area is not managed by using a file system, so that the erasing times of the FAT table are reduced, and the erasing times of the storage medium are limited. In addition, the mapping relation between the number of sectors (Flash-small storage area, in sector units) needed to be copied to the backup area in the log buffer area and the number of sectors to be migrated data stored in the log buffer area is stored in the backup SRAM (power-off data-not-lost area) inside the chip, and when the machine is accidentally powered off or the power is manually powered off, the mapping relation between the file storage areas of the two parts is not lost, so that the file under the power-off condition is also protected.
The application also provides a storage medium, and the storage medium stores program instructions of the wear balancing method of the breathing machine file storage medium, which can be loaded and executed by a processor. Specifically, the storage medium includes at least one type of readable storage medium including flash memory, a hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, and the like. The storage medium may be used not only for storing various types of data, such as program instructions of a wear leveling method of a ventilator file storage medium, etc., but also for temporarily storing data that has been output or is to be output, such as a work file generated by a ventilation work of a ventilator. The storage medium adopts all the technical solutions of all the embodiments, so that the storage medium has at least all the beneficial effects brought by the technical solutions of the embodiments, and is not described herein.
The application also provides a ventilator 900. Ventilator 900 includes a memory 901 and a memory 902. Specifically, the memory 901 is configured to store program instructions of a wear balancing method of a ventilator file storage medium, and the processor 902 is configured to execute the program instructions to enable the ventilator to implement the wear balancing method of the ventilator file storage medium. Referring to fig. 8 in combination, a schematic diagram of an internal structure of a ventilator 900 according to a first embodiment of the present application is shown. Ventilator 900 includes at least memory 901 and processor 902.
The memory 901 includes at least one type of readable storage medium including flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. Memory 901 may be an internal storage unit of ventilator 900, such as a hard disk of ventilator 900, in some embodiments. The memory 901 may also be an external storage device of the ventilator 900 in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital Card (SD), a Flash Card (Flash Card) or the like, which are provided on the ventilator 900. Further, the memory 901 may also include both internal storage units and external storage devices of the ventilator 900. The memory 901 may be used to store not only application software installed on the ventilator 900 and various data, such as program instructions of a wear leveling method of a ventilator file storage medium, but also temporarily store data that has been output or is to be output, such as a work file generated by a ventilation work of the ventilator.
The processor 902 may be a central processing unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor or other data processing chip in some embodiments for executing program instructions or processing data stored in the memory 901. Specifically, the processor 902 executes program instructions of the method of wear leveling of the ventilator file storage medium to control the ventilator 900 to implement the method of wear leveling of the ventilator file storage medium.
Further, the ventilator 900 may further include a bus 903, which may be a peripheral component interconnect standard bus (peripheral component interconnect, abbreviated as PCI) or an extended industry standard architecture bus (extended industry standard architecture, abbreviated as EISA), or the like. The bus may be classified as an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in fig. 8, but not only one bus or one type of bus.
Further, ventilator 900 may also include a display assembly 904. The display component 904 may be an LED (Light Emitting Diode) display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display component 904 may also be referred to as a display device or display unit, as appropriate, for displaying information processed in the ventilator 900 and for displaying a visual user interface.
Further, ventilator 900 may also include a communication component 905, and communication component 905 may optionally include a wired communication component and/or a wireless communication component (e.g., WI-FI communication component, bluetooth communication component, etc.), typically used to establish a communication connection between ventilator 900 and other computer devices.
Fig. 8 illustrates only a ventilator 900 having components 901-905 and program instructions for implementing a method of wear balancing a ventilator file storage medium, it will be understood by those skilled in the art that the configuration illustrated in fig. 8 is not limiting of ventilator 900 and may include fewer or more components than illustrated, or may combine certain components, or a different arrangement of components. Because the ventilator 900 adopts all the technical solutions of all the embodiments, at least the advantages of the technical solutions of the embodiments are provided, and will not be described in detail herein.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the above-described method embodiments, and are not repeated herein.
In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the above-described embodiments of the method of wear leveling of a ventilator file storage medium are merely illustrative, e.g., the partitioning of the units is merely a logical functional partitioning, and may be implemented in other ways, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present application without departing from the spirit or scope of the application. Thus, if and when such modifications and variations of the present application fall within the scope of the claims and the equivalents thereof, the present application is intended to encompass such modifications and variations.
The above list of preferred embodiments of the present application is, of course, not intended to limit the scope of the application, and equivalent variations according to the claims of the present application are therefore included in the scope of the present application.

Claims (9)

1. A method of wear leveling a file storage medium, the method comprising:
dividing a storage area of a Flash storage medium into a log buffer area and a file backup area, wherein the log buffer area comprises a plurality of first sectors, and the file backup area comprises a plurality of second sectors;
when the equipment is in a working state, writing a working file generated by the current work into a plurality of corresponding first sectors in the log buffer;
acquiring a plurality of idle second sectors from a file system, wherein the file system is a system for managing the file backup area;
generating a mapping table for representing the transfer of the working file from the first sectors occupied by the working file to the second sectors free according to the first sectors occupied by the working file and the second sectors free, wherein generating the mapping table according to the first sectors occupied by the working file and the second sectors free comprises: calculating a first number of owned sectors in a plurality of first sectors occupied by the working file; dividing the first number of second sectors from the idle number of second sectors; and generating the mapping table according to the IDs of the first number of first sectors and the first number of second sectors;
writing the mapping table into an SRAM;
when the equipment is in a standby state, judging whether the mapping table exists in the SRAM or not; and
and when the mapping table exists in the SRAM, transferring the working file stored in the log buffer area to the file backup area according to the mapping table stored in the SRAM.
2. The method for wear leveling a file storage medium of claim 1, wherein when the device is in an operational state, writing the operational file generated by the current operation to corresponding first sectors in the log buffer comprises:
acquiring a writing address in the log buffer area; and
and writing the working file into the corresponding first sectors sequentially from the writing address.
3. The method of wear leveling a file storage medium of claim 2, further comprising, prior to writing the working file to the corresponding first plurality of sectors in sequence from the write address:
judging whether the log buffer area is fully written; and
when the log buffer has been full, overwriting the working file from the first sector of the log buffer.
4. The method of wear leveling a file storage medium of claim 1, further comprising, when the device is in an operating state and a standby state:
judging whether the equipment is powered off or not; and
when the device is powered down, a standby power supply is enabled to supply power to the SRAM.
5. The method of wear leveling a file storage medium of claim 1, wherein generating the mapping table based on IDs of a first number of first sectors and the first number of second sectors, comprises:
acquiring a first number of first sector IDs in the first number of first sectors;
acquiring a first number of second sector IDs in the first number of second sectors;
generating a mapping relation according to the first number of first sector IDs and the first number of second sector IDs; and
and generating the mapping table according to the first quantity and the mapping relation.
6. The method of wear leveling a file storage medium of claim 2, wherein the method of wear leveling a file storage medium further comprises:
judging whether all the working files are transferred to the file backup area or not; and
and when all the working files are transferred to the file backup area, updating the writing address capable of writing the working files in the log buffer area.
7. The method of wear leveling a file storage medium of claim 1, wherein the free second sectors have a storage space that is greater than a storage space required for a working file generated by a single operation of the device.
8. A storage medium having stored thereon program instructions of the wear leveling method of a file storage medium according to any one of claims 1 to 7 that can be loaded and executed by a processor.
9. A ventilator, the ventilator comprising:
a memory for storing program instructions of a wear leveling method of the file storage medium; and
a processor for executing the program instructions to cause the ventilator to implement the method of wear leveling of a file storage medium according to any one of claims 1-7.
CN202011642115.2A 2020-12-31 2020-12-31 Wear balancing method for file storage medium, storage medium and breathing machine Active CN114691533B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011642115.2A CN114691533B (en) 2020-12-31 2020-12-31 Wear balancing method for file storage medium, storage medium and breathing machine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011642115.2A CN114691533B (en) 2020-12-31 2020-12-31 Wear balancing method for file storage medium, storage medium and breathing machine

Publications (2)

Publication Number Publication Date
CN114691533A CN114691533A (en) 2022-07-01
CN114691533B true CN114691533B (en) 2023-09-05

Family

ID=82135482

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011642115.2A Active CN114691533B (en) 2020-12-31 2020-12-31 Wear balancing method for file storage medium, storage medium and breathing machine

Country Status (1)

Country Link
CN (1) CN114691533B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1866399A (en) * 2005-05-16 2006-11-22 松下电器产业株式会社 Storage controller, involatile storage,involatile storage system and data inputting method
CN103176752A (en) * 2012-07-02 2013-06-26 晶天电子(深圳)有限公司 Super-endurance solid-state drive with Endurance Translation Layer (ETL) and diversion of temp files for reduced Flash wear
CN110175001A (en) * 2019-05-27 2019-08-27 牧星机器人(江苏)有限公司 A kind of NOR-FLASH date storage method, computer equipment and storage medium
CN112035294A (en) * 2020-08-25 2020-12-04 华东计算技术研究所(中国电子科技集团公司第三十二研究所) Security log file system, and implementation method and medium thereof

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7363540B2 (en) * 2002-10-22 2008-04-22 Microsoft Corporation Transaction-safe FAT file system improvements
US7650458B2 (en) * 2006-06-23 2010-01-19 Microsoft Corporation Flash memory driver
US9547589B2 (en) * 2008-06-18 2017-01-17 Super Talent Technology, Corp. Endurance translation layer (ETL) and diversion of temp files for reduced flash wear of a super-endurance solid-state drive

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1866399A (en) * 2005-05-16 2006-11-22 松下电器产业株式会社 Storage controller, involatile storage,involatile storage system and data inputting method
CN103176752A (en) * 2012-07-02 2013-06-26 晶天电子(深圳)有限公司 Super-endurance solid-state drive with Endurance Translation Layer (ETL) and diversion of temp files for reduced Flash wear
CN110175001A (en) * 2019-05-27 2019-08-27 牧星机器人(江苏)有限公司 A kind of NOR-FLASH date storage method, computer equipment and storage medium
CN112035294A (en) * 2020-08-25 2020-12-04 华东计算技术研究所(中国电子科技集团公司第三十二研究所) Security log file system, and implementation method and medium thereof

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
MFTL: A Design and Implementation for MLC Flash Memory Storage Systems;Jen-Wei Hsieh;《ACM Transactions on Storage》;第8卷(第2期);全文 *

Also Published As

Publication number Publication date
CN114691533A (en) 2022-07-01

Similar Documents

Publication Publication Date Title
US8230160B2 (en) Flash memory storage system and flash memory controller and data processing method thereof
US10222982B2 (en) Lifetime management device and lifetime management method
US7802054B2 (en) Apparatus and methods using invalidity indicators for buffered memory
US9501231B2 (en) Storage system and storage control method
US10331584B2 (en) Internal system namespace exposed through use of two local processors and controller memory buffer with two reserved areas
US10198318B2 (en) Storage apparatus having nonvolatile memory device, and nonvolatile memory device
US8112575B2 (en) Memory controller, nonvolatile memory device, access device, and nonvolatile memory system
EP2189894A1 (en) Digital shoebox
JP2010049586A (en) Flash memory-mounted storage apparatus
JP4633886B2 (en) Disk array device
JP2009169650A (en) Computer system, management computer, and data management method
KR20070039957A (en) Method and device to improve usb flash write performance
US10152260B2 (en) Information system, management program, and program exchange method of information system
US8819387B2 (en) Memory storage device, memory controller, and method for identifying valid data
US9009440B2 (en) Adjustment of data storage capacity provided by a storage system
US20110231621A1 (en) System recovery method, and storage medium controller and storage system using the same
US20100115187A1 (en) Non-volatile data storage system and method thereof
TWI540435B (en) Memory system capable of prohibiting access to application software and system software
US11803222B2 (en) Systems and methods for managing reduced power failure energy requirements on a solid state drive
CN114691533B (en) Wear balancing method for file storage medium, storage medium and breathing machine
US9372700B2 (en) Network boot system
US8601100B2 (en) System and method for booting multiple servers from a single operating system image
CN109002258A (en) NameSpace distribution method, system and equipment and storage medium in solid state hard disk
JP2008027162A (en) Data recording apparatus and data recording program
CN116560561A (en) Storage method, storage management device, storage disk and storage system

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