CN115687270A - Data storage sorting method and device, electronic equipment and storage medium - Google Patents

Data storage sorting method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115687270A
CN115687270A CN202110869718.4A CN202110869718A CN115687270A CN 115687270 A CN115687270 A CN 115687270A CN 202110869718 A CN202110869718 A CN 202110869718A CN 115687270 A CN115687270 A CN 115687270A
Authority
CN
China
Prior art keywords
data
memory
file
data storage
identification 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.)
Pending
Application number
CN202110869718.4A
Other languages
Chinese (zh)
Inventor
高山
何逍阳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software 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 Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN202110869718.4A priority Critical patent/CN115687270A/en
Publication of CN115687270A publication Critical patent/CN115687270A/en
Pending legal-status Critical Current

Links

Images

Abstract

The present disclosure provides a data storage sorting method, apparatus, electronic device and storage medium, which are applied to a memory, and the method includes: and if the fragmentation state of the file in the memory reaches a preset state, performing data storage and sorting according to identification information stored in the memory or according to the identification information carried in the received data sorting instruction, wherein a plurality of data blocks of the file subjected to data storage and sorting are distributed in a section of continuous physical storage area in the memory. The data storage arrangement mode of the embodiment of the disclosure distributes the files in a section of continuous physical storage area in order, further optimizes the arrangement of the physical storage area of the data blocks, enables a plurality of data blocks of the same file to be continuously read during data access, improves the efficiency of data access, and improves the performance and user experience of the memory.

Description

Data storage arrangement method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of storage technologies, and in particular, to a data storage sorting method and apparatus, an electronic device, and a storage medium.
Background
Taking an embedded memory chip as an example, the breakthrough of the embedded memory chip in speed and capacity is laid down as a cornerstone for industries such as 5G (5 th Generation Mobile Communication Technology), big data, intelligent interconnection, and the like. However, as the service time of the memory chip is prolonged, the fragmentation degree of data inside the memory chip is more serious, which affects the stability and performance of the electronic device, and causes poor data access efficiency, reduced product performance and poor user experience. For example: the more the handset is used, the more it is stuck.
Disclosure of Invention
The disclosure provides a data storage arrangement method, a data storage arrangement device, electronic equipment and a storage medium.
According to an embodiment of a first aspect of the present disclosure, there is provided a data storage sorting method, applied to a memory, the method including:
if the fragmentation state of the file in the memory reaches a preset state, acquiring identification information of the file;
and performing data storage arrangement according to the identification information, wherein a plurality of data blocks of the same file subjected to data storage arrangement are distributed in a section of continuous physical storage area in the memory.
In some embodiments, the obtaining the identification information of the file if the fragmentation state of the file in the memory reaches a preset state includes:
if the fragmentation state of the file in the memory reaches a preset state, receiving a data sorting instruction from a processor; and the data sorting instruction carries the identification information.
In some embodiments, the identification information includes at least a logical address of the file.
In some embodiments, the obtaining the identification information of the file if the fragmentation state of the file in the memory reaches the preset state includes:
if the fragmentation state of the file in the memory reaches the preset state, generating a data sorting instruction; wherein the data sorting instruction carries the identification information stored in the memory.
In some embodiments, a plurality of the data blocks have a logical address and a first physical address before the data store consolidation;
the data storage and sorting according to the identification information comprises:
and updating the first physical address to a second physical address to obtain a mapping relation between the logical address and the second physical address.
In some embodiments, the performing data storage sorting according to the identification information includes:
if the memory is processing the task, interrupting the task;
saving the interrupted on-site information of the task;
after the data storage and sorting are performed according to the identification information, the method comprises the following steps:
and recovering the interrupted task according to the field information.
According to an embodiment of a second aspect of the present disclosure, there is provided a data storage sorting apparatus applied to a memory, the apparatus including:
the acquisition module is used for acquiring the identification information of the file when the fragmentation state of the file in the memory reaches a preset state;
and the sorting module is used for storing and sorting data according to the identification information, wherein a plurality of data blocks of the file subjected to data storage sorting are distributed in a section of continuous physical storage area in the memory.
In some embodiments, the obtaining module is further configured to:
if the fragmentation state of the file in the memory reaches the preset state, receiving a data sorting instruction from a processor; and the data sorting instruction carries the identification information.
In some embodiments, the obtaining module is further configured to:
if the fragmentation state of the file in the memory reaches the preset state, generating a data sorting instruction; wherein the data sorting instruction carries the identification information stored in the memory.
In some embodiments, a plurality of the data blocks have a logical address and a first physical address before the data storage consolidation is performed;
the sorting module is further configured to:
and the modification module is used for changing the first physical address into a second physical address to obtain the mapping relation between the logical address and the second physical address.
In some embodiments, the collation module is further configured to:
if the memory is processing a task, interrupting the task;
saving the interrupted site information of the task;
the device, still include:
and the recovery module is used for recovering the interrupted task according to the field information.
According to an embodiment of a third aspect of the present disclosure, there is provided an electronic apparatus including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to: when implemented, the method steps described in the embodiments of the first aspect are performed.
According to a fourth aspect of the present disclosure, there is provided a computer-readable storage medium, on which a computer program is stored, which when executed by a processor of an electronic device, enables the electronic device to perform the method steps of implementing the embodiments of the first aspect.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
it can be known from the foregoing embodiment that, in the embodiment of the present disclosure, the storage performs data storage and sorting according to the identification information by acquiring the identification information of the file, so that the overall concept of the storage on the file is improved, and the storage can determine which data blocks belong to the same file. Therefore, the memory does not insert the data blocks of other files into the data blocks of the same file, but distributes the data blocks of the same file into a section of continuous physical storage area in the memory. The data storage arrangement mode distributes the files in a section of continuous physical storage area in order, further optimizes the arrangement of the physical storage area of the data blocks, enables a plurality of data blocks of the same file to be continuously read during data access, improves the data access efficiency, and improves the performance and user experience of the memory.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a schematic flow chart of data storage arrangement in the related art;
FIG. 2 is a second schematic flow chart of data storage arrangement in the related art;
FIG. 3 is a third schematic flow chart of data storage arrangement in the related art;
FIG. 4 is a fourth schematic flow chart of data storage arrangement in the related art;
FIG. 5 is one of the flow diagrams of a data storage consolidation method shown in accordance with an exemplary embodiment;
FIG. 6 is a second schematic flow chart diagram illustrating a data storage consolidation method according to an exemplary embodiment;
FIG. 7 is a third schematic flow chart diagram illustrating a data storage consolidation method in accordance with an exemplary embodiment;
FIG. 8 is a fourth flowchart illustrating a data storage consolidation method according to an exemplary embodiment;
FIG. 9 is a schematic diagram illustrating the structure of a data storage organizing device, according to an exemplary embodiment;
fig. 10 is a block diagram illustrating a configuration of an apparatus for data storage consolidation according to an exemplary embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of devices consistent with certain aspects of the present disclosure, as detailed in the appended claims.
The memory is exemplified by a NAND Flash memory (NAND Flash), and the storage principle of such a memory is roughly as follows: as shown in fig. 1, data a is written in a Logical Block of a virtual storage space visible to a user, where a Logical Address (also referred to as a Logical Block Address, LBA or LBA, logical Block Address) indicates a data Logical file storage Address, and the Logical Block is a part of the virtual space. According to the mapping relationship between the logical address and the physical address (also referred to as address mapping in fig. 1), the final data a is written into the physical storage space as a data block, wherein the physical storage space includes a plurality of physical storage areas, and each physical storage area includes a plurality of data pages (data pages storing the data block are represented by pageN, where N is a positive integer greater than or equal to 0). The physical Address (also called physical Block Address, PBA or PBA, physics Block Address) is the actual physical storage Address of the data.
As shown in fig. 2, it is assumed that data is written at page0 (corresponding to physical address n), and then data is written at page1 (corresponding to physical address n + 1). Then the page0 data is updated, but the updated data is not overwritten, and the FTL (Flash translation layer) writes it to the corresponding physical address (n + 2) and then marks it as "invalid" (corresponding physical address n). For example: in fig. 2, after the update at a in LBA is a', a in the physical storage area is "invalid". After many such operations, the physical storage area is filled with a lot of "valid" and "invalid" data. If the data is written into the physical storage area again, the data in the whole physical storage area needs to be erased, and all the "valid" data needs to be copied to another blank physical storage area before erasing. Such an operation is GC (i.e., garbage Collection).
The GC copies valid data blocks in a physical storage area (block) into another block, and erases the block. Fig. 3 and 4 exemplarily show the processing procedure of the GC, in which the arrow points to the direction of data transfer, the address in fig. 3 refers to a physical address, and the data page with a letter in fig. 3 and 4 indicates that the data is invalid data.
In practical application, the memory does not have the concept of the whole file, and in this case, if the data blocks in the multiple physical storage areas are sorted, although the multiple data blocks can be distributed in a section of continuous physical storage area in the memory, the multiple data blocks of the same file are still relatively dispersed, and the arrangement of the physical storage areas after data storage sorting is still not optimized enough.
As shown in fig. 5, a first aspect of the present disclosure provides a data sorting method applied to a memory, where the method includes the following steps:
s110, if the fragmentation state of the file in the memory reaches a preset state, acquiring identification information of the file;
and S120, performing data storage arrangement according to the identification information, wherein a plurality of data blocks of the file subjected to data storage arrangement are distributed in a section of continuous physical storage area in the memory.
In step S110, the file generally includes file data and identification information of the file. In which file data may be divided into a plurality of data blocks during storage, and these data blocks may be distributed in discrete physical storage areas. Therefore, when the file is read, data needs to be read in a plurality of discrete physical storage areas in a pointer turning mode and other modes, so that the file reading rate is low, and further, the problem of unsmooth operation of equipment and the like is caused for a user.
For example, using the identification information, it may be determined whether multiple data blocks belong to the same file, or in which physical storage areas multiple data blocks of the same file are distributed.
Therefore, by acquiring the identification information of the file, data storage and sorting are facilitated according to the identification information, and the overall concept of the file by the storage is improved.
In some embodiments, the identification information includes at least a logical address of the file. By means of the logical addresses, the physical addresses of a plurality of data blocks belonging to the same file can be determined.
In some embodiments, the identification information includes, but is not limited to: the logical address of the file, the number of the file or the type of the file, etc.
The fragmentation status indicates a discrete state of the same file distributed in the physical storage area. If the ratio of the physical storage areas for storing the effective data blocks in a certain section of continuous physical storage areas of the memory is smaller than a first preset ratio, the fragmentation state reaches a preset state. For example: in 100 continuous physical storage areas, if the number of the physical storage areas for storing the valid data blocks is 50, the number of the physical storage areas for storing the invalid data blocks is 30, and the number of the blank physical storage areas for not storing the data is 20, the percentage of the physical storage areas for storing the valid data blocks is 50%, and if the first preset percentage is 60%, the fragmentation state is in a preset state, and data storage and sorting are required; and if the proportion of the physical storage area for storing the effective data block is more than or equal to 60%, the fragmentation state is not reached to the preset state, and data storage sorting is not needed.
Or, if the ratio of the physical storage areas storing the valid data blocks in the plurality of continuous physical storage areas in which data are written is less than a second preset ratio, the fragmentation state reaches a preset state. For example: 220 physical storage areas are arranged in the memory, wherein the first 100 continuous physical storage areas are provided with data blocks, the number of the physical storage areas for storing valid data blocks in the 100 physical storage areas is 75, the number of the physical storage areas for storing invalid data blocks is 25, the proportion of the physical storage areas for storing valid data blocks is 65%, and if the second preset proportion is 70%, the fragmentation state is in a preset state, and data storage and sorting are required; and if the proportion of the physical storage area for storing the effective data block is more than or equal to 70%, the fragmentation state is not reached to the preset state, and data storage sorting is not needed.
Or counting the reading distance generated when reading the plurality of physical storage areas and storing all data blocks of the same file, wherein the reading distance is in direct proportion to the fragmentation degree, and the larger the reading distance is, the larger the fragmentation degree is, the more serious the fragmentation state is; the smaller the reading distance, the smaller the fragmentation degree, and the lighter the fragmentation degree. And if the reading distance is greater than the preset distance, the fragmentation state reaches a preset state. For example: the storage is exemplified by a magnetic disk, and the magnetic disk comprises three storage disks of an E disk, an F disk and a G disk, and each storage disk has a plurality of physical storage areas. If a plurality of data blocks of the file a are all located on the E disk, part of the data blocks of the file b are located on the E disk, and the rest of the data blocks are located on the G disk, when the file is read, the reading distance generated by the file a is smaller than that of the file b, and the fragmentation degree of the file a is not serious than that of the file b.
In step S120, in the embodiment of the present disclosure, the memory performs data storage and sorting according to the identification information by acquiring the identification information of the file, so that the overall concept of the file by the memory is improved, and the memory can determine which data blocks belong to the same file. Therefore, the memory does not insert the data blocks of other files into the data blocks of the same file, but distributes the data blocks of the same file into a section of continuous physical storage area in the memory. The data storage arrangement mode further optimizes the arrangement of the physical storage areas of the data blocks, so that a plurality of data blocks of the same file can be continuously read during data access, the data access efficiency is improved, and the performance and the user experience of the memory are improved.
When the memory is used for a long time, the fragmentation state of the physical arrangement of the data blocks in the memory is serious. As shown in the storage state B in fig. 6, the data blocks of file 1, file 2 and file 3 in the long-term-use memory are distributed very discretely, and invalid data blocks are inserted in the middle, wherein a plurality of data blocks of file 1 are represented by "1-K", where K is a positive integer between 1 and 7; a plurality of data blocks of the file 2 are represented by '2-L', wherein L is a positive integer between 1 and 13; a plurality of data blocks of the file 3 are represented by 3-M, wherein M is a positive integer between 1 and 16; invalid data blocks are denoted by "x" and physical memory regions (free blocks) where no data is stored are denoted by blank boxes. As can be seen from the storage state B in fig. 6, not only the physical storage areas of the same file are distributed discretely, but also different data blocks of the same file are distributed out of order. For example: for file 1, file 1 includes 7 data blocks, 1-1, 1-2, 1-3, 1-4, 1-5, 1-6, and 1-7, respectively, but the physical storage areas of these 7 data blocks are not contiguous in storage state B, and 1-1 is followed by 1-4 instead of 1-2, i.e., the individual data blocks are distributed out of order.
And distributing a plurality of data blocks of the same file in a section of continuous physical storage area in the memory according to the identification information to obtain an organized storage state C. When the storage state is C, the data blocks of the same file are distributed in a section of continuous physical storage area, and the data blocks are distributed in order. For example: for the file 1, the data blocks of the file 1 after being sorted are sequentially distributed according to the sequence of 1-1, 1-2, 1-3, 1-4, 1-5, 1-6 and 1-7. The data storage and sorting enables the files to be accessed orderly and continuously, improves the access speed of the files, and keeps higher file reading performance.
Moreover, after finishing the data arrangement, a plurality of files in the memory are distributed on a continuous physical area, so that the fragmentation of the memory space in the memory is reduced. Illustratively, as shown in the storage state C in fig. 6, the data blocks of two adjacent files are distributed continuously, and the data blocks of the files are distributed from the start position of the physical storage space, which makes the physical storage area where no data is stored more continuous, and provides a continuous storage space for subsequently written data. In the data sorting process, not only the valid data blocks are sorted, but also the invalid data blocks need to be deleted. Compared with the state B and the state C in the FIG. 6, the invalid data block x is deleted, the data blocks of different files are arranged, and the storage space occupied by the invalid data block x can be released through deleting the invalid data block x, so that the effective utilization of the storage space of the memory is improved.
In other optional embodiments, the obtaining the identification information of the file if the fragmentation state of the file in the memory reaches the preset state includes:
if the fragmentation state of the file in the memory reaches a preset state, receiving a data sorting instruction from a processor; and the data sorting instruction carries the identification information.
And receiving a data sorting instruction which is sent by the processor and carries the identification information, so that the memory does not need to store the identification information, and the occupation of a physical storage area of the memory is reduced. For example: when the processor sends the file to the memory, the memory can only store the file data (namely the file content) without storing the file identification information, which is beneficial to reducing the occupation of the physical storage area due to the identification information of the stored file.
Without limitation, as shown in fig. 6, the memory (Device) includes a memory Controller (Controller) and a memory space (NAND). The storage controller obtains the fragmentation state of the file in the storage space, and then sends the fragmentation state of the file in the storage space to the processor (Host). When the fragmentation state reaches a preset state, the processor sends a data sorting instruction (instruction, MD, command) to the memory controller to perform data processing on the data blocks in the memory space.
In other optional embodiments, the obtaining the identification information of the file if the fragmentation state of the file in the memory reaches the preset state includes:
if the fragmentation state of the file in the memory reaches a preset state, generating a data sorting instruction; wherein the data sorting instruction carries the identification information stored in the memory.
In addition to the data store consolidation triggered by the processor, the memory may also automatically trigger data store consolidation. In this embodiment, the processor may store the identification information while storing the file data, and when the fragmentation state of the file reaches the preset state, automatically trigger the data storage sorting, thereby improving the efficiency of the data storage sorting.
In the embodiment of the disclosure, the memory can acquire the identification information according to the received data sorting instruction, and perform the data storage sorting; or when the fragmentation state of the memory reaches a preset state, acquiring the identification information stored by the memory, and storing and sorting the data.
In other optional embodiments, a plurality of the data blocks have a logical address and a first physical address before the data storage consolidation is performed;
the data storage and sorting according to the identification information includes:
and updating the first physical address to a second physical address to obtain a mapping relation between the logical address and the second physical address.
Generally, after data storage is sorted, the logical address of the data block is not changed, but the physical storage area of the data block is changed, that is, the physical address of the data block is changed from a first physical address to a second physical address, and the mapping relationship between the logical address and the physical address needs to be updated, that is, the mapping relationship between the logical address and the first physical address is updated to the mapping relationship between the logical address and the second physical address, so as to read and write data subsequently.
Since the logical address is maintained unchanged and only the physical address of the file is changed in the data sorting process, the storage address of the data is unchanged for the user after the data sorting, and the user can know the file which the user wants to find in the original storage directory.
In other optional embodiments, the performing, according to the identification information, data storage sorting includes:
if the memory is processing the task, interrupting the task;
saving the interrupted on-site information of the task;
after the data storage and sorting are performed according to the identification information, the method comprises the following steps:
and recovering the interrupted task according to the field information.
In practical application, if the fragmentation state of the file reaches a preset state, and the memory is performing task processing such as writing or reading at the moment, the tasks need to be interrupted, and after finishing sorting and storing data, the interrupted task is recovered.
Interrupted tasks can be recovered using the field information. The context information may be thread information. The field information includes but is not limited to: various register information for a thread, such as the contents of general purpose registers, the contents of control registers, stack information and/or pointer information, etc.
In summary, in the embodiments of the present disclosure, the live information may be used to restore the current execution state of the task when the task is resumed.
In the embodiment of the present disclosure, the data storage is sorted after the task is interrupted or within the time of the idle state.
In some embodiments, the performing data storage sorting according to the identification information includes:
and determining whether the current time is preset time, and if the current time is the preset time, storing and sorting data according to the identification information.
The preset time refers to the time when the memory has no task to be processed and is in an idle state. The preset time may be a sleep time of a designated general user, for example: the preset time is 23.
Or analyzing the daily work and rest of the user through the user state information reflected by the wearable device or the use state information of the memory, and determining the preset time according to the daily work and rest of the user.
In some embodiments, as shown in fig. 7, the data storage organizing method is applied to an electronic device, wherein the electronic device includes a processor and a memory, and the method includes the following steps:
step S210, the processor inquires the fragmentation state of the file in the memory, and when the fragmentation state reaches a preset state, the working state of the memory is determined;
step S220, if the memory is processing the task, after the memory interrupts the task and stores the interrupted field information of the task, the processor establishes a data storage and sorting instruction according to the identification information of the file number, the initial LBA of the file, the file type and the like in the file system, and sends the instruction to the memory;
step S230, the memory receives a data sorting instruction of the processor;
and S240, the memory stores and arranges data according to the identification information. Namely: the memory finds a corresponding first physical address (PBA) through an L2P table (a mapping relation table of the logical address and the first physical address) according to a file starting LBA sent by the processor, moves a plurality of data blocks of the file to a physical storage area with a second physical address through information such as a file number and/or a file type and the like through data movement, optimizes the arrangement of different data blocks of the same file in a physical storage space, and updates the mapping relation between the logical address and the first physical address in the L2P table into the mapping relation between the logical address and the second physical address. As shown in fig. 6, a plurality of data blocks of the same file after data storage sorting are distributed in a segment of continuous physical storage area in the memory;
and S250, the memory recovers the interrupted task according to the field information. For identification information, the processor may choose to keep or delete as needed.
In some embodiments, as shown in fig. 8, the data storage organizing method is applied to an electronic device, where the electronic device includes a processor and a memory, and the method includes the following steps:
step S310, the processor sends file data and identification information of the file to the memory;
step S320, a memory receives the file data and the identification information and respectively stores the file data and the identification information;
step S330, the memory triggers data storage and sorting when the fragmentation state of the file reaches a preset state according to the set preset state;
step S340, the memory finds a first physical address (PBA) according to the stored identification information and through the mapping relation between the logical address and the first physical address in the L2P mapping table, moves a plurality of data blocks of the file to a second physical address, optimizes the overall arrangement of the file on a physical storage area, namely, a plurality of data blocks of the same file which are arranged through data storage are distributed in a section of continuous physical storage area in the memory;
in step S350, the memory updates the mapping relationship between the logical address and the first physical address in the L2P table to the mapping relationship between the logical address and the second physical address.
In the embodiment of the present disclosure, the electronic device includes, but is not limited to, a mobile phone, a tablet computer, a notebook computer, a wearable device, and the like.
In a second aspect of the present disclosure, a data storage sorting apparatus is provided, and as shown in fig. 9, the apparatus 400 includes:
an obtaining module 410, configured to obtain identification information of a file when a fragmentation state of the file in the memory reaches a preset state;
and the sorting module 420 is configured to perform data storage sorting according to the identification information, where a plurality of data blocks of the file after data storage sorting are distributed in a segment of continuous physical storage area in the memory.
In other optional embodiments, the obtaining module is further configured to:
if the fragmentation state of the file in the memory reaches a preset state, receiving a data sorting instruction from a processor; and the data sorting instruction carries the identification information.
In other optional embodiments, the obtaining module is further configured to:
if the fragmentation state of the file in the memory reaches a preset state, generating a data sorting instruction; wherein the data sorting instruction carries the identification information stored in the memory.
In other optional embodiments, a plurality of the data blocks have a logical address and a first physical address before the data storage consolidation is performed;
the sorting module is further configured to:
and the modification module is used for changing the first physical address into a second physical address to obtain the mapping relation between the logical address and the second physical address.
In other optional embodiments, the sorting module is further configured to:
if the memory is processing a task, interrupting the task;
saving the interrupted site information of the task;
the device, still include:
and the recovery module is used for recovering the interrupted task according to the field information.
An embodiment of a third aspect of the embodiments of the present disclosure provides an electronic device, including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to: when implemented, perform the method steps described in the first embodiment.
A fourth aspect of the embodiments of the present disclosure provides a computer-readable storage medium, on which a computer program is stored, where instructions of the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the method steps described in the first aspect of the embodiments.
In the embodiment of the present disclosure, a plurality of modules in the data storage and organization apparatus may be implemented by one or more Central Processing Units (CPUs), graphics Processing Units (GPUs), baseband Processors (BPs), application Specific Integrated Circuits (ASICs), DSPs, programmable Logic Devices (PLDs), complex Programmable Logic Devices (CPLDs), field Programmable Gate Arrays (FPGAs), general purpose processors, controllers, micro Controllers (MCUs), microprocessors (microprocessors), or other electronic components, for executing the foregoing method.
Fig. 10 is a block diagram illustrating an apparatus 800 for information processing according to an example embodiment. For example, the apparatus 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 10, the apparatus 800 may include one or more of the following components: processing component 802, memory 804, power component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, sensor component 814, and communication component 816.
The processing component 802 generally controls overall operation of the device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 802 may include one or more processors 820 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operations at the apparatus 800. Examples of such data include instructions for any application or method operating on device 800, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Power components 806 provide power to the various components of device 800. The power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the apparatus 800.
The multimedia component 808 includes a screen that provides an output interface between the device 800 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the device 800 is in an operation mode, such as a photographing mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the apparatus 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 814 includes one or more sensors for providing various aspects of state assessment for the device 800. For example, the sensor assembly 814 may detect the open/closed status of the device 800, the relative positioning of components, such as a display and keypad of the device 800, the sensor assembly 814 may also detect a change in the position of the device 800 or a component of the device 800, the presence or absence of user contact with the device 800, the orientation or acceleration/deceleration of the device 800, and a change in the temperature of the device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate communication between the apparatus 800 and other devices in a wired or wireless manner. The apparatus 800 may access a wireless network based on a communication standard, such as WiFi,4G or 5G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as the memory 804 comprising instructions, executable by the processor 820 of the device 800 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
The methods disclosed in the several method embodiments provided in this disclosure may be combined arbitrarily without conflict to arrive at new method embodiments.
The features disclosed in the several method or apparatus embodiments provided in this disclosure may be combined in any combination to arrive at a new method or apparatus embodiment without conflict.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (13)

1. A data storage grooming method, for application to a memory, the method comprising:
if the fragmentation state of the file in the memory reaches a preset state, acquiring identification information of the file;
and performing data storage arrangement according to the identification information, wherein a plurality of data blocks of the file subjected to data storage arrangement are distributed in a section of continuous physical storage area in the memory.
2. The data storage arrangement method according to claim 1, wherein the obtaining of the identification information of the file if the fragmentation state of the file in the memory reaches a preset state comprises:
if the fragmentation state of the file in the memory reaches the preset state, receiving a data sorting instruction from a processor; and the data sorting instruction carries the identification information.
3. A data storage grooming method according to claim 1 or 2, characterized in that the identification information comprises at least the logical address of the file.
4. The data storage arrangement method according to claim 1, wherein the obtaining of the identification information of the file if the fragmentation state of the file in the memory reaches a preset state comprises:
if the fragmentation state of the file in the memory reaches the preset state, generating a data sorting instruction; wherein the data sorting instruction carries the identification information stored in the memory.
5. The data storage arrangement method according to claim 1, wherein a plurality of the data blocks have a logical address and a first physical address before the data storage arrangement is not performed;
the data storage and sorting according to the identification information comprises:
and updating the first physical address to a second physical address to obtain a mapping relation between the logical address and the second physical address.
6. The method for sorting data storage according to claim 1, wherein the sorting data storage according to the identification information comprises:
if the memory is processing the task, interrupting the task;
saving the interrupted on-site information of the task;
after the data storage and sorting are performed according to the identification information, the method comprises the following steps:
and recovering the interrupted task according to the field information.
7. A data storage organizing device, applied to a memory, the device comprising:
the acquisition module is used for acquiring the identification information of the file when the fragmentation state of the file in the memory reaches a preset state;
and the sorting module is used for storing and sorting data according to the identification information, wherein a plurality of data blocks of the file subjected to data storage sorting are distributed in a section of continuous physical storage area in the memory.
8. The data storage collating device of claim 7, wherein the obtaining module is further configured to:
if the fragmentation state of the file in the memory reaches the preset state, receiving a data sorting instruction from a processor; and the data sorting instruction carries the identification information.
9. The data storage collating device of claim 7, wherein the obtaining module is further configured to:
if the fragmentation state of the file in the memory reaches the preset state, generating a data sorting instruction; wherein the data sorting instruction carries the identification information stored in the memory.
10. The data storage arrangement of claim 7, wherein a plurality of said data blocks have a logical address and a first physical address before said data storage arrangement is performed;
the sorting module is further configured to:
and the modification module is used for changing the first physical address into a second physical address to obtain the mapping relation between the logical address and the second physical address.
11. The data storage collating device of claim 7 wherein the collating module is further configured to:
if the memory is processing the task, interrupting the task;
saving the interrupted on-site information of the task;
the device, still include:
and the recovery module is used for recovering the interrupted task according to the field information.
12. An electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to: when implemented, perform the method steps of any of claims 1 to 6.
13. A computer-readable storage medium, on which a computer program is stored, characterized in that instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the method steps of implementing any of claims 1 to 6.
CN202110869718.4A 2021-07-30 2021-07-30 Data storage sorting method and device, electronic equipment and storage medium Pending CN115687270A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110869718.4A CN115687270A (en) 2021-07-30 2021-07-30 Data storage sorting method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110869718.4A CN115687270A (en) 2021-07-30 2021-07-30 Data storage sorting method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115687270A true CN115687270A (en) 2023-02-03

Family

ID=85058058

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110869718.4A Pending CN115687270A (en) 2021-07-30 2021-07-30 Data storage sorting method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115687270A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116400871A (en) * 2023-06-09 2023-07-07 Tcl通讯科技(成都)有限公司 Defragmentation method, defragmentation device, storage medium and electronic device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116400871A (en) * 2023-06-09 2023-07-07 Tcl通讯科技(成都)有限公司 Defragmentation method, defragmentation device, storage medium and electronic device
CN116400871B (en) * 2023-06-09 2023-09-19 Tcl通讯科技(成都)有限公司 Defragmentation method, defragmentation device, storage medium and electronic device

Similar Documents

Publication Publication Date Title
CN109683714B (en) Multimedia resource management method, device and storage medium
US20110307836A1 (en) Mobile terminal and controlling method thereof
US20150024728A1 (en) Mobile terminal and controlling method thereof
US20110080356A1 (en) Mobile terminal and method of controlling application execution in a mobile terminal
CN107562347B (en) Method and device for displaying object
KR102014083B1 (en) Method and device for managing memory in terminal
CN115145735B (en) Memory allocation method and device and readable storage medium
KR20150033202A (en) Mobile terminal and method for controlling the same
CN112835501A (en) Display method and electronic equipment
CN115687270A (en) Data storage sorting method and device, electronic equipment and storage medium
EP4131055A1 (en) Annotation method and electronic device
CN116360671A (en) Storage method, storage device, terminal and storage medium
KR20240010042A (en) Data access methods, devices, and non-transitory computer-readable storage media
CN114461312B (en) Display method, electronic device and storage medium
CN114428589A (en) Data processing method and device, electronic equipment and storage medium
CN114610656A (en) Data replacement method and device, electronic equipment and storage medium
CN112965920A (en) Memory management method and device, electronic equipment and storage medium
CN114077461A (en) Application program running method, device, equipment and storage medium
KR101752413B1 (en) Mobile terminal and method for controlling the same
CN112162704A (en) Storage space releasing method and device
CN116560587B (en) Data management system and terminal equipment
CN110968523A (en) Memory defragmentation method and device
CN112068761B (en) Touch screen data processing method, touch screen data processing device and storage medium
CN110134370A (en) A kind of method, apparatus of graphic plotting, electronic equipment and storage medium
CN111241097B (en) Method for processing object, device for processing object and storage medium

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