CN110221781B - Manufacturing method and device of disk fragments, storage medium and intelligent terminal - Google Patents

Manufacturing method and device of disk fragments, storage medium and intelligent terminal Download PDF

Info

Publication number
CN110221781B
CN110221781B CN201910482110.9A CN201910482110A CN110221781B CN 110221781 B CN110221781 B CN 110221781B CN 201910482110 A CN201910482110 A CN 201910482110A CN 110221781 B CN110221781 B CN 110221781B
Authority
CN
China
Prior art keywords
disk
target
file
test
files
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
CN201910482110.9A
Other languages
Chinese (zh)
Other versions
CN110221781A (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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201910482110.9A priority Critical patent/CN110221781B/en
Publication of CN110221781A publication Critical patent/CN110221781A/en
Application granted granted Critical
Publication of CN110221781B publication Critical patent/CN110221781B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0608Saving storage space on storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/24Arrangements for testing

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the application discloses a manufacturing method and device of disk fragments, a storage medium and an intelligent terminal. The method comprises the steps of obtaining attribute information of a disk fragment to be manufactured; acquiring at least two test files according to the attribute information, and storing data corresponding to each test file to an idle disk block in a target disk at intervals so as to fill the target disk; determining the group of each test file in the target disk, deleting at least one group of test files, writing the target file to be fragmented and stored into the target disk after the test files are deleted, so that data corresponding to the target file are stored in the target disk at intervals, and disk fragments corresponding to the target file are obtained, thereby providing a test basis for testing operations such as unsmooth clamping, system fluency or system stability and the like, and optimizing the performance of the intelligent terminal.

Description

Manufacturing method and device of disk fragments, storage medium and intelligent terminal
Technical Field
The embodiment of the application relates to a terminal technology, in particular to a manufacturing method and device of disk fragments, a storage medium and an intelligent terminal.
Background
Disk fragmentation, also known as file fragmentation, is caused by files being stored scattered throughout the disk in different places, rather than being stored in contiguous disk blocks. Disk fragmentation can significantly reduce the operating speed of the hard disk because the hard disk needs to jump between fragments to read a file, increasing the latency of waiting for the disk to rotate to a specified sector and the seek time required for the head to switch tracks.
Currently, there are many related studies on the fragmentation of a clean disk in the related art. Defragmentation is a technique in which defragmentation of disks generated by an intelligent terminal after a period of use is collected and stored as a continuous whole on a hard disk. However, in the testing stage of the new intelligent terminal, the influence of disk fragmentation on the system performance needs to be considered, and a technical scheme for simulating the generation of disk fragmentation after the intelligent terminal is used for a period of time is lacked in the related art, and further, a testing basis for optimizing the related performance of the intelligent terminal is lacked.
Disclosure of Invention
The embodiment of the application provides a manufacturing method and device of disk fragments, a storage medium and an intelligent terminal, which can provide a test basis for the intelligent terminal so as to optimize the performance of the intelligent terminal.
In a first aspect, an embodiment of the present application provides a method for manufacturing a disk fragment, including:
acquiring attribute information of disk fragments to be manufactured;
acquiring at least two test files according to the attribute information, and storing data corresponding to each test file to an idle disk block in a target disk at intervals so as to fill the target disk;
determining the group of each test file in the target disk, deleting at least one group of test files, and writing the target file to be subjected to fragmentation storage into the target disk after the test files are deleted, so that the data corresponding to the target file is stored in the target disk at intervals.
In a second aspect, an embodiment of the present application further provides an apparatus for manufacturing a disk fragment, the apparatus including:
the information acquisition module is used for acquiring the attribute information of the disk fragments to be manufactured;
the test file writing module is used for acquiring at least two test files according to the attribute information, and storing data corresponding to each test file to an idle disk block in a target disk at intervals so as to fill the target disk;
the embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the method for manufacturing a disk fragment according to the embodiment of the present invention.
In a fourth aspect, an embodiment of the present application further provides an intelligent terminal, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor executes the computer program to implement the method for manufacturing the disk fragments according to the embodiment of the present application.
The embodiment of the application provides a manufacturing scheme of disk fragments, data corresponding to at least two test files are stored to a target disk at intervals to fill the target disk, a storage space is released by deleting at least one group of test files, and the target file is written in the newly released storage space, so that the data corresponding to the target file are stored at intervals to obtain the disk fragments corresponding to the target file, and therefore a test basis is provided for testing operations such as blockage, system fluency or system stability, and the performance of an intelligent terminal is optimized.
Drawings
FIG. 1 is a flow chart of a method for manufacturing a disk fragment according to an embodiment of the present disclosure;
FIG. 2 is a flow chart of another method for manufacturing disk fragments according to an embodiment of the present disclosure;
fig. 3 is a schematic diagram illustrating a distribution of disk blocks in a target disk according to an embodiment of the present application;
fig. 4 is a schematic diagram of a distribution situation of disk blocks occupied by each test file in a process of creating a 4k disk fragment according to an embodiment of the present application;
fig. 5 is a schematic diagram of a distribution situation of disk blocks occupied by each test file in an 8k disk fragment creating process according to an embodiment of the present application;
FIG. 6 is a schematic diagram of a target disk for deleting a set of test files according to an embodiment of the present application;
fig. 7 is a schematic diagram of a target disk written with a target file after a group of test files is deleted according to an embodiment of the present application;
FIG. 8 is a schematic diagram of a target disk for writing multiple target files according to an embodiment of the present application;
FIG. 9 is a schematic structural view of an apparatus for manufacturing a disk fragment according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of an intelligent terminal according to an embodiment of the present application;
fig. 11 is a block diagram of a smart phone according to an embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of and not restrictive on the broad application. It should be further noted that, for the convenience of description, only some of the structures related to the present application are shown in the drawings, not all of the structures.
Before discussing exemplary embodiments in greater detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the steps as a sequential process, many of the steps can be performed in parallel, concurrently or simultaneously. In addition, the order of the steps may be rearranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.
Fig. 1 is a flowchart of a manufacturing method of a disk fragment according to an embodiment of the present application, where the embodiment is applicable to a system performance test situation of an intelligent terminal, and the method may be executed by a manufacturing apparatus of a disk fragment, where the apparatus may be implemented by hardware and/or software and is generally integrated in an intelligent terminal. As shown in fig. 1, the method includes:
and step 110, acquiring attribute information of the disk fragments to be manufactured.
The intelligent terminal in this embodiment includes an electronic device configured with an operating system, such as a smart phone, a tablet computer, a digital camera, a vehicle-mounted computer, an intelligent household appliance, and an intelligent wearable device.
Wherein the attribute information is data related to the attribute of the disk fragment to be manufactured. Disk shards may be identified by attribute information. For example, the attribute information includes a target type and a target storage space occupied by the disk fragmentation. The target type includes the size of each file fragment in the disk fragment. Since disk fragmentation is caused by the fact that files are stored in different storage locations of the entire disk in a scattered manner, each storage location stores a file fragment, and the size of the file fragment is taken as a target type. For example, the target type may be 4k, 8k, 16k, 32k, or the like, to the power of 2. The target storage space occupied by the disk fragment, i.e. the sum of the discrete storage spaces occupied by the disk fragment in the entire disk.
For example, before manufacturing the disk fragments, attribute information of the disk fragments to be manufactured may be specified according to test requirements. The target type of the disk fragment to be manufactured and the target storage space occupied by the disk fragment may be specified in advance. For example, the specified manufacturing target type is 4k and the target storage space is 2G of disk fragments. It should be noted that there may be many attribute information, and the attribute information that needs to be specified before manufacturing the disk fragment may further include other information.
And 120, acquiring at least two test files according to the attribute information, and storing data corresponding to each test file to an idle disk block in the target disk at intervals so as to fill the target disk.
The test file is a file occupying different disk blocks of the target disk in the test process. For example, the test file may be a pre-created file having a set size. Or after the attribute information of the disk fragment to be created is specified, a test file of a set size is generated according to the attribute information. Or a file of a set size obtained from the internet, etc. The target disk is a disk to be written to the disk fragment, the disk having a plurality of disk blocks of a set size, wherein a disk block is an indivisible storage space in the disk. For example, the size of each disk block may be 4 k. A free disk block is the smallest unit of storage in the disk that has not been written to.
It should be noted that, since the capacity of the target disk may be large, there is a case where the same detection file is repeatedly written, at this time, it may be determined that the detection files with the same file name belong to the same group, that is, the test files with the same file name belong to the same group. For example, two test files may be written to the target disk in a loop manner, so as to separate the data of one test file from the data of another test file, thereby deleting a group of test files, i.e. obtaining discontinuous free disk blocks. It can be understood that the groups of the acquired test files may be more than 2 types, and the greater the number of the groups of the test files, the more scattered the data corresponding to the test files written to the target disk.
It should be noted that the larger the size of the test file is, the fewer the number of files required to fill the target disk; the smaller the size of the test file, the greater the number of files required to fill the target disk. For example, if the capacity of the target disk is 4G, 4 test files are created, and the size of each test file is 1G, then it is desired that the disk fragment 4k occupies the storage space of the target disk 1G, and the free disk block of 1G can be obtained by deleting any one test file. Continuing with the above example, if the size of each test file is 0.1G, then it is desired that the disk fragment 4k occupy the storage space of the target disk 1G, requiring deletion of multiple test files in any set of test files.
Although the larger the size of the test file is, the less test files need to be deleted when the test file is deleted, the larger the size of the test file is, the longer it takes to write the test file to the target disk. When the size of the test file is smaller, the test file to be deleted needs to be positioned in a time-consuming mode when the test file is deleted, and the number of the deleted test files is larger. Therefore, the size and the number of the test files have the influence on the storage and the deletion of the test files, and the size of the test files can be selected according to actual test requirements. For example, at least two test files may be obtained according to the attribute information of the disk fragment to be created, including: judging whether the size of the target storage space exceeds a preset threshold value or not; if so, acquiring at least two test files corresponding to the first file size; otherwise, at least two test files corresponding to the second file size are obtained, wherein the second file size is smaller than the first file size.
Illustratively, after obtaining at least two test files, at least two threads are started, and each thread is responsible for writing one test file to the target disk. And writing data corresponding to the test file into the free disk block of the target disk sequentially through the started at least two threads. For example, assuming that a disk fragment to be created occupies a disk storage space 2G by 4k, 2 test files F1 and F2 are obtained, and the sizes of the two test files are both 16k, two threads F1 and F2 are started, the first 4k data of the test file F1 is written into the first free disk block of the target disk through the thread F1, and then the thread F1 suspends the writing operation; the first 4k data of the test file F2 is written by thread F2 to the second free disk block adjacent to the first free disk block, and subsequently, thread F2 suspends the write operation. Writing, by the thread F1, the second 4k data of the test file F1 to the third free disk block adjacent to the second free disk block, and subsequently, the thread F1 suspends the writing operation; writing, by thread F2, the second 4k data of test file F2 to the fourth free disk block adjacent to the third free disk block, and subsequently, thread F2 suspends the write operation; and circularly executing the steps until the test file fills the whole target disk. After the fourth 4k data of the test files F1 and F2 are written to the target disk, if the target disk is not full, the data corresponding to the test files F1 and F2 are repeatedly written to the target disk.
It should be noted that, by increasing the groups of the test files, the data corresponding to each test file is spaced farther apart, so that the created disk fragments can be fragmented more. For example, if 4 test files F1, F2, F3, and F4 are obtained, and the size of each of the four test files is 16k, it usually needs to be 3 disk blocks apart for writing 4k of data corresponding to the test file. For example, 10 test files F1 to F10 are obtained, and the size of ten test files is 16k, so for each test file, it usually needs to be separated by 9 disk blocks to write 4k of data corresponding to the test file.
Step 130, deleting at least one group of test files, and writing a target file to be stored in a fragmentized manner into the target disk after the test files are deleted, so that data corresponding to the target file are stored in the target disk at intervals.
It should be noted that the same group of test files has the same identification information, and deletion of a group of test files can be realized by one instruction. For example, by executing the instruction to delete the test file F1, it is possible to delete all the test files with the file name F1 in the target disk.
It should be noted that the target file is real data to be stored to the target disk. For example, the target file may be related files such as configuration data of the application a, a display effect file, or a history message file.
Illustratively, any set of test files is deleted, resulting in free storage space. Because the data corresponding to the test file is stored in the disk blocks of the target disk at intervals, if the test file is deleted, a plurality of idle disk blocks distributed at intervals can be obtained. The sum of the capacities of the plurality of free disk blocks may be taken as free storage space. And judging whether the size of the free storage space is larger than or equal to a target storage space occupied by the disk fragments to be created. And if so, writing a target file to be subjected to fragmentation storage into the free storage space, and deleting the remaining test files in the target disk to enable data corresponding to the target file to be stored in the target disk at intervals, so that disk fragments of the target file are obtained. Otherwise, executing the operation of returning and executing the deletion of any group of test files to delete more test files and further obtain more free storage space.
According to the technical scheme of the embodiment, the data corresponding to at least two test files are stored to the target disk at intervals to fill the target disk, the storage space is released in a mode of deleting at least one group of test files, and the target file is written in the newly released storage space, so that the data corresponding to the target file are stored at intervals to obtain the disk fragments corresponding to the target file, and therefore a test basis is provided for testing operations such as blockage, system fluency or system stability and the like, and the performance of the intelligent terminal is optimized.
In some embodiments, after obtaining at least two test files according to the attribute information, the method further includes: and acquiring a target disk in an idle state, and labeling each disk block of the target disk to obtain a disk block number. Since the disk number of each disk block in the disk may be a string of characters, it is difficult to memorize. In order to facilitate the write operation of the subsequent test file, after the target disk in the idle state is acquired, numbering each disk block in the target disk to obtain a disk block number.
Fig. 2 is a flowchart of another manufacturing method of a disk fragment according to an embodiment of the present application, and as shown in fig. 2, the method includes:
step 210, obtaining a target type of a disk fragment to be manufactured and a target storage space occupied by the disk fragment.
Step 220, obtaining at least two test files according to the attribute information, obtaining a target disk in an idle state, and labeling each disk block of the target disk to obtain a disk block number.
Fig. 3 is a schematic diagram of a distribution of disk blocks in a target disk according to an embodiment of the present application. In fig. 3, each disk block is a free disk block, and each disk block has a disk block number, such as blk1, blk2, blk3 … ….
And step 230, determining the distribution information of the free disk blocks occupied by each test file according to the target type.
The distribution information comprises the occupation condition of a file segment of the test file to the free disk block. For example, the distribution information of the disk blocks includes that one file segment of the test file occupies one free disk block, or that one file segment of the test file occupies a plurality of consecutive free disk blocks.
In the embodiment of the application, because the distribution conditions of the disk blocks occupied by each file fragment in the test files of different target types are different, the distribution information of the disk blocks occupied by each test file can be determined according to the target type before the test file is written into the target disk. Assuming the target type is 4k of disk fragmentation, a file fragment occupies one free disk block. Fig. 4 is a schematic diagram of a distribution situation of disk blocks occupied by each test file in a process of creating a 4k disk fragment according to an embodiment of the present application. Assuming that there are 4 test files and the size of each test file is 16k, the distribution of the disk blocks occupied by each test file is as follows:
File1.txt=16k=blk1+blk5+blk9+blk13
File2.txt=16k=blk2+blk6+blk10+blk14
File3.txt=16k=blk3+blk7+blk11+blk15
File4.txt=16k=blk4+blk8+blk12+blk16
as shown in fig. 4, each file segment of the test file occupies one free disk block, and different file segments of the same test file are not consecutive.
Alternatively, assuming the target type is 8k disk fragmentation, one file fragment occupies two consecutive free disk blocks. Fig. 5 is a schematic diagram of a distribution situation of disk blocks occupied by each test file in an 8k disk fragment creating process according to an embodiment of the present application. Assuming that there are 4 test files and the size of each test file is 32k, the distribution of the disk blocks occupied by each test file is as follows:
File1.txt=32k=blk1+blk2+blk9+blk10+blk17+blk18+blk25+blk26
File2.txt=32k=blk3+blk4+blk11+blk12+blk19+blk20+blk27+blk28
File3.txt=32k=blk5+blk6+blk13+blk14+blk21+blk22+blk29+blk30
File4.txt=32k=blk7+blk8+blk15+blk16+blk23+blk24+blk31+blk32
as shown in fig. 5, each file segment of the test file occupies two consecutive free disk blocks, and different file segments of the same test file are not consecutive.
The method can improve the accuracy and efficiency of writing the test file by predetermining the occupation condition of the test file to the idle disk block.
And 240, writing data corresponding to each test file into the free disk block in the target disk based on the distribution information, so that the target disk is fully filled.
For example, assuming that the total space occupied by 4k of disk fragments required to be created is 1G, 4 test files are created, and the size of each test file is 16k, 4 threads are started, and the test files are written into the target disk respectively according to a set sequence. In general, the threads sequentially perform write operations, and each thread performs a write operation, and writes data corresponding to one file fragment to one free disk block in the target disk, which shows the situation of occupied disk blocks as shown in fig. 4.
However, in the actual writing process, there may be an intersection between the threads, and a file segment corresponding to a write operation executed later may be written into the target disk first, so that the occupation situation of the test file on the disk block becomes:
File1.txt=16k=blk1+blk7+blk9+blk13
File2.txt=16k=blk2+blk5+blk10+blk14
File3.txt=16k=blk3+blk6+blk11+blk15
File4.txt=16k=blk4+blk8+blk12+blk16
and writing the second test file and the third test file into the target disk before the first test file.
After the 4 test files are all written into the target disk, whether the target disk is filled with the test files is judged. If not, the test file is repeatedly written according to the mode until the target disk is filled.
Step 250, determining the group to which each test file in the target disk belongs, deleting at least one group of test files, and writing the target file to be stored in a fragmentized manner into the target disk after the test files are deleted, so that the data corresponding to the target file is stored in the target disk at intervals.
Fig. 6 is a schematic diagram of a target disk for deleting a set of test files according to an embodiment of the present application. As shown in fig. 6, when file1.txt is deleted, blk1, blk5, blk9, and blk13 … … are freed, and a plurality of free disk blocks are obtained. And calculating the sum of the storage spaces corresponding to the free disk blocks to obtain the free storage space. And judging whether the size of the free storage space exceeds the target storage space. If so, writing a target file to be subjected to fragmentation storage into the free storage space, and deleting the remaining test files in the target disk to obtain disk fragments of the target file. Fig. 7 is a schematic diagram of a target disk written with a target file after a group of test files is deleted according to an embodiment of the present application. As shown in FIG. 7, blk1, blk5, blk9, blk13 … … are additionally populated with data corresponding to the target file.
If the size of the free storage space is smaller than the target storage space, file3.txt is deleted, and blk3, blk7, blk11 and blk15 … … are free. At this time, the free disk blocks include blk1, blk3, blk5, blk7, blk9, blk11, blk13, and blk 5. And calculating the sum of the storage spaces corresponding to the free disk blocks to be compared with the target storage space. And if the free storage space is smaller than the target storage space, continuously deleting the group of detection files. And if the free storage space exceeds the target storage space after the 3 groups of detection files are deleted, writing the target files to be subjected to fragmentation storage into the free storage space. If the free storage space is still smaller than the target storage space after the 3 groups of detection files are deleted, the setting of the 4 detection files is unreasonable. Deleting all the test files and increasing the number of groups of the test files, for example, creating 6 test files, circularly writing the 6 test files into the target disk according to a set sequence, and then executing the operation of deleting one group of test files according to the above manner.
And step 260, acquiring the size type and the number of the file fragments included in the folder corresponding to the target file.
In the embodiment of the application, after the target file is written into the target disk, the folder corresponding to the target file is determined. The types and the number of sizes of the file fragments of all the files contained in the folder are acquired. For example, the size types of the file fragments in the folder are obtained, including 4k, 8k, 16k, 32k, 64k, and the like, and the number of file fragments of each size type is counted. And determining the quantity proportion of the file fragments of each size type according to the quantity of each file fragment.
Step 270, judging whether the folder meets the fragmentation requirement according to the size type and the number of the file fragments, if so, executing step 280, otherwise, executing step 290.
In this embodiment, the fragmentation requirement may be a proportional number of each file fragment contained in the folder. And if the determined quantity proportion of the file fragments of each size type is matched with the quantity proportion value of the corresponding file fragments in the fragmentation requirement, determining that the folder meets the fragmentation requirement, otherwise, determining that the folder does not meet the fragmentation requirement.
Step 280, determining that the manufacture of the disk fragments is successful.
In the embodiment of the application, if the type and the number of the sizes of the file fragments in the folder meet the fragmentation requirement, it is determined that the disk fragmentation is successfully manufactured.
Fig. 8 is a schematic diagram of a target disk written with multiple target files according to an embodiment of the present application. After creating 4k disk fragments in the target disk, 8k disk fragments may be continuously created, and the target disk storing the 4k disk fragments and the 8k disk fragments is obtained.
Step 290, deleting the target file, determining the type and the number of the file fragments and the difference information of the fragmentation requirement, acquiring at least two new test files according to the difference information, and returning to execute step 230.
In the embodiment of the application, the number proportion of the sizes of the file fragments is determined according to the types and the numbers of the sizes of the file fragments contained in the folder, the number proportion is compared with the number proportion of the sizes of the corresponding file fragments in the fragmentation requirement, and at least two new test files are obtained according to the comparison result. For example, if the comparison result is that the ratio of the number of 8k disk fragments is smaller than the requirement of the ratio of the number of 8k disk fragments in the fragmentation requirement, the test files are retrieved, and the size of each test file is at least 32 k.
According to the technical scheme of the embodiment, after the target file is written, the type and the number of the sizes of the file fragments included in the folder corresponding to the target file are obtained, whether the folder meets the fragmentation requirement or not is judged according to the type and the number, when the folder does not meet the fragmentation requirement, the original test file is deleted from the target disk, and the test file is obtained again to manufacture new disk fragments, so that the fragmentation requirement of the folder where the target file is located is met while the fragmentation storage of the target file is met.
Fig. 9 is a schematic structural diagram of an apparatus for manufacturing a disk fragment according to an embodiment of the present disclosure, where the apparatus may be implemented by software and/or hardware, and may be generally integrated in an intelligent terminal. As shown in fig. 9, the apparatus includes:
an information obtaining module 910, configured to obtain attribute information of a disk fragment to be manufactured;
a test file writing module 920, configured to obtain at least two test files according to the attribute information, and store data corresponding to each test file to an idle disk block in a target disk at intervals, so as to fill the target disk;
the target file writing module 930 is configured to determine a group to which each test file in the target disk belongs, delete at least one group of test files, and write a target file to be stored in a fragmented manner into the target disk after the test file is deleted, so that data corresponding to the target file is stored in the target disk at intervals.
The embodiment of the application provides a manufacturing device of disk fragments, which stores data corresponding to at least two test files to a target disk at intervals so as to fill the target disk, releases a storage space by deleting at least one group of test files, and writes the target file in the newly released storage space, so that the data corresponding to the target file are stored at intervals, and the disk fragments corresponding to the target file are obtained, thereby providing a test basis for testing operations such as jamming, system fluency or system stability and the like, and optimizing the performance of an intelligent terminal.
Optionally, the attribute information includes a target type and a target storage space occupied by the disk fragment, where the target type includes a size of each file fragment in the disk fragment.
Optionally, the test file writing module 920 is specifically configured to:
determining the distribution information of the idle disk blocks occupied by each test file according to the target type;
and writing data corresponding to each test file into the free disk blocks in the target disk based on the distribution information, so that the target disk is fully filled.
Optionally, the test file writing module 920 is specifically configured to:
judging whether the size of the target storage space exceeds a preset threshold value or not;
if so, acquiring at least two test files corresponding to the first file size;
otherwise, at least two test files corresponding to the second file size are obtained, wherein the second file size is smaller than the first file size.
Optionally, the target file writing module 930 is specifically configured to:
deleting any group of test files to obtain a free storage space;
judging whether the size of the free storage space exceeds the target storage space or not;
if so, writing a target file to be subjected to fragmentation storage into the free storage space, and deleting the residual test files in the target disk to obtain disk fragments of the target file;
otherwise, executing the operation of deleting any group of test files.
Optionally, the method further includes:
after writing a target file to be fragmented and stored into a target disk from which a test file is deleted, acquiring the size type and the number of file fragments included in a folder corresponding to the target file;
judging whether the folder meets the fragmentation requirement or not according to the type and the number;
if yes, the manufacture of the disk fragments is determined to be successful.
Optionally, the method further includes:
if the folder does not meet the fragmentation requirement, deleting the target file;
and determining the type and the number of the file fragments and the difference information of the fragmentation requirements, acquiring at least two new test files according to the difference information, and performing operation of storing the data corresponding to each test file to the free disk block in the target disk at intervals.
Embodiments of the present application also provide a storage medium containing computer-executable instructions, which when executed by a computer processor, perform a method for manufacturing fragmented magnetic disks, the method including:
acquiring attribute information of disk fragments to be manufactured;
acquiring at least two test files according to the attribute information, and storing data corresponding to each test file to an idle disk block in a target disk at intervals so as to fill the target disk;
determining the group of each test file in the target disk, deleting at least one group of test files, and writing the target file to be stored in a fragmentized manner into the target disk after the test files are deleted, so that the data corresponding to the target file are stored in the target disk at intervals.
Storage medium-any of various types of memory devices or storage devices. The term "storage medium" is intended to include: mounting media such as CD-ROM, floppy disk, or tape devices; computer system memory or random access memory such as DRAM, DDR RAM, SRAM, EDO RAM, Lanbas (Rambus) RAM, etc.; non-volatile memory such as flash memory, magnetic media (e.g., hard disk or optical storage); registers or other similar types of memory elements, etc. The storage medium may also include other types of memory or combinations thereof. In addition, the storage medium may be located in a first computer system in which the program is executed, or may be located in a different second computer system connected to the first computer system through a network (such as the internet). The second computer system may provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media that may reside in different locations, such as in different computer systems that are connected by a network. The storage medium may store program instructions (e.g., embodied as a computer program) that are executable by one or more processors.
Of course, the storage medium provided in this embodiment of the present application contains computer-executable instructions, and the computer-executable instructions are not limited to the above-mentioned operations for manufacturing the disk fragments, and may also perform related operations in the method for manufacturing the disk fragments provided in any embodiment of the present application.
The embodiment of the application provides an intelligent terminal, and the manufacturing device of the disk fragments provided by the embodiment of the application can be integrated in the intelligent terminal. The intelligent terminal can be a smart phone, a PAD (PAD computer), a handheld game console, an intelligent household appliance, a vehicle-mounted terminal, an intelligent wearable device and the like. Fig. 10 is a schematic structural diagram of an intelligent terminal according to an embodiment of the present application. As shown in fig. 10, the smart terminal includes a memory 1010 and a processor 1020. The memory 1010 is used for storing computer programs and the like; the processor 1020 reads and executes the computer programs stored in the memory 1010. The processor 1020, when executing the computer program, performs the steps of: acquiring attribute information of disk fragments to be manufactured; acquiring at least two test files according to the attribute information, and storing data corresponding to each test file to an idle disk block in a target disk at intervals so as to fill the target disk; determining the group of each test file in the target disk, deleting at least one group of test files, and writing the target file to be stored in a fragmentized manner into the target disk after the test files are deleted, so that the data corresponding to the target file are stored in the target disk at intervals.
The memory and the processor listed in the above examples are all part of components of the intelligent terminal, and the intelligent terminal may further include other components. A possible structure of the above-mentioned intelligent terminal is described by taking a smart phone as an example. Fig. 11 is a block diagram of a smart phone according to an embodiment of the present application. As shown in fig. 11, the smart phone may include: memory 1101, a Central Processing Unit (CPU) 1102 (also known as a processor, hereinafter CPU), a peripheral interface 1103, a Radio Frequency (RF) circuit 1105, an audio circuit 1106, a speaker 1111, a touch screen 1112, a power management chip 1108, an input/output (I/O) subsystem 1109, other input/control devices 1110, and an external port 1104, which communicate via one or more communication buses or signal lines 1107.
It should be understood that the illustrated smartphone 1100 is merely one example of a smart terminal, and that the smartphone 1100 may have more or fewer components than shown in the figures, may combine two or more components, or may have a different configuration of components. The various components shown in the figures may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
The following describes in detail a smart phone integrated with a manufacturing apparatus for a disk fragment according to this embodiment.
A memory 1101, the memory 1101 accessible by the CPU1102, the peripheral interface 1103, or the like, the memory 1101 comprising a high speed random access memory and a non-volatile memory such as one or more magnetic disk storage devices, flash memory devices, or other volatile solid state storage devices
A peripheral interface 1103, where the peripheral interface 1103 may connect input and output peripherals of the device to the CPU1102 and the memory 1101.
An I/O subsystem 1109, the I/O subsystem 1109 may connect input and output peripherals on the device, such as the touch screen 1112 and other input/control devices 1110, to the peripheral interface 1103. The I/O subsystem 1109 may include a display controller 11091 and one or more input controllers 11092 for controlling other input/control devices 1110. Where one or more input controllers 11092 receive electrical signals from or send electrical signals to other input/control devices 1110, the other input/control devices 1110 may include physical buttons (push buttons, rocker buttons, etc.), dials, slide switches, joysticks, click wheels, etc. It is noted that the input controller 11092 may be connected to any one of the following: a keyboard, an infrared port, a USB interface, and a pointing device such as a mouse.
A touch screen 1112, which touch screen 1112 is an input interface and an output interface between the user terminal and the user, displays visual output to the user, which may include graphics, text, icons, video, and the like.
The display controller 11091 in the I/O subsystem 1109 receives electrical signals from the touch screen 1112 or sends electrical signals to the touch screen 1112. The touch screen 1112 detects a contact on the touch screen, the display controller 11091 converts the detected contact into an interaction with a user interface object displayed on the touch screen 1112, i.e., implements a human-machine interaction, and the user interface object displayed on the touch screen 1112 may be an icon for running a game, an icon networked to a corresponding network, or the like. It is worth mentioning that the device may also comprise a light mouse, which is a touch sensitive surface that does not show visual output, or an extension of the touch sensitive surface formed by the touch screen.
The RF circuit 1105 is mainly used to establish communication between the mobile phone and the wireless network (i.e., network side), so as to receive and transmit data between the mobile phone and the wireless network. Such as sending and receiving short messages, e-mails, etc. In particular, RF circuit 1105 receives and transmits RF signals, also referred to as electromagnetic signals, through which RF circuit 1105 converts electrical signals to or from electromagnetic signals and communicates with a communication network and other devices. The RF circuitry 1105 may include known circuitry for performing these functions including, but not limited to, an antenna system, an RF transceiver, one or more amplifiers, a tuner, one or more oscillators, a digital signal processor, a CODEC (CODEC) chipset, a Subscriber Identity Module (SIM), and so forth.
The audio circuit 1106 is mainly used to receive audio data from the peripheral interface 1103, convert the audio data into an electric signal, and transmit the electric signal to the speaker 1111.
And the loudspeaker 1111 is used for restoring the voice signal received by the mobile phone from the wireless network through the RF circuit 1105 into sound and playing the sound to the user.
And a power management chip 1108 for supplying power and managing power to the hardware connected to the CPU1102, the I/O subsystem, and the peripheral interface.
The intelligent terminal provided by the embodiment of the application realizes the interval storage of the data corresponding to the target file to obtain the disk fragments corresponding to the target file, thereby providing a test basis for the test operations such as blockage, system fluency or system stability and the like to optimize the performance of the intelligent terminal.
The manufacturing device, the storage medium and the intelligent terminal for the disk fragments provided in the above embodiments can execute the manufacturing method for the disk fragments provided in any embodiment of the present application, and have corresponding functional modules and beneficial effects for executing the method. For technical details that are not described in detail in the above embodiments, reference may be made to a method of manufacturing a disk fragment provided in any of the embodiments of the present application.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present application and the technical principles employed. It will be understood by those skilled in the art that the present application is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the application. Therefore, although the present application has been described in more detail with reference to the above embodiments, the present application is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present application, and the scope of the present application is determined by the scope of the appended claims.

Claims (8)

1. A method of manufacturing a disk chip, comprising:
acquiring attribute information of disk fragments to be manufactured;
acquiring at least two test files according to the attribute information, and storing data corresponding to each test file to an idle disk block in a target disk at intervals so as to fill the target disk;
determining the group of each test file in the target disk, deleting at least one group of test files, and writing the target file to be subjected to fragmentation storage into the target disk after the test files are deleted so as to enable the data corresponding to the target file to be stored in the target disk at intervals;
the attribute information comprises a target type and a target storage space occupied by the disk fragments, wherein the target type comprises the size of each file fragment in the disk fragments;
acquiring at least two test files according to the attribute information, comprising:
judging whether the size of the target storage space exceeds a preset threshold value or not;
if so, acquiring at least two test files corresponding to the first file size;
otherwise, at least two test files corresponding to the second file size are obtained, wherein the second file size is smaller than the first file size.
2. The method of claim 1, wherein storing the data interval corresponding to each test file to a free disk block in a target disk to fill the target disk, comprises:
determining the distribution information of the free disk blocks occupied by each test file according to the target type;
and writing data corresponding to each test file into the free disk blocks in the target disk based on the distribution information, so that the target disk is fully filled.
3. The method of claim 1, wherein deleting at least one set of test files and writing target files to be fragmented for storage into the target disk after deleting the test files comprises:
deleting any group of test files to obtain a free storage space;
judging whether the size of the free storage space exceeds the target storage space or not;
if yes, writing a target file to be subjected to fragmentation storage into the free storage space, and deleting the remaining test files in the target disk to obtain disk fragments of the target file;
otherwise, executing the operation of deleting any group of test files.
4. The method according to any one of claims 1 to 3, further comprising, after writing the target file to be fragmented for storage into the target disk after deleting the test file:
acquiring the size type and the number of file fragments included in a folder corresponding to the target file;
judging whether the folder meets fragmentation requirements or not according to the type and the number;
if yes, the disk fragment is determined to be successfully manufactured.
5. The method of claim 4, further comprising:
if the folder does not meet the fragmentation requirement, deleting the target file;
and determining the type and the number of the file fragments and the difference information of the fragmentation requirements, acquiring at least two new test files according to the difference information, and performing operation of storing the data corresponding to each test file to the free disk block in the target disk at intervals.
6. An apparatus for manufacturing a magnetic disk chip, comprising:
the information acquisition module is used for acquiring the attribute information of the disk fragments to be manufactured;
the test file writing module is used for acquiring at least two test files according to the attribute information, and storing data corresponding to each test file to an idle disk block in a target disk at intervals so as to fill the target disk;
the target file writing module is used for determining the group to which each test file in the target disk belongs, deleting at least one group of test files, and writing the target file to be stored in a fragmentized manner into the target disk after the test files are deleted so as to enable the data corresponding to the target file to be stored in the target disk at intervals;
the attribute information comprises a target type and a target storage space occupied by the disk fragments, wherein the target type comprises the size of each file fragment in the disk fragments;
the test file writing module is specifically configured to:
judging whether the size of the target storage space exceeds a preset threshold value or not;
if so, acquiring at least two test files corresponding to the first file size;
otherwise, at least two test files corresponding to the second file size are obtained, wherein the second file size is smaller than the first file size.
7. A computer-readable storage medium on which a computer program is stored, which, when being executed by a processor, carries out the method for manufacturing a magnetic disk fragment according to any one of claims 1 to 5.
8. An intelligent terminal, comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor executes the computer program to implement the method of manufacturing disk fragments according to any one of claims 1 to 5.
CN201910482110.9A 2019-06-04 2019-06-04 Manufacturing method and device of disk fragments, storage medium and intelligent terminal Active CN110221781B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910482110.9A CN110221781B (en) 2019-06-04 2019-06-04 Manufacturing method and device of disk fragments, storage medium and intelligent terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910482110.9A CN110221781B (en) 2019-06-04 2019-06-04 Manufacturing method and device of disk fragments, storage medium and intelligent terminal

Publications (2)

Publication Number Publication Date
CN110221781A CN110221781A (en) 2019-09-10
CN110221781B true CN110221781B (en) 2022-08-23

Family

ID=67819627

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910482110.9A Active CN110221781B (en) 2019-06-04 2019-06-04 Manufacturing method and device of disk fragments, storage medium and intelligent terminal

Country Status (1)

Country Link
CN (1) CN110221781B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111209257B (en) * 2020-01-15 2023-05-09 西安奥卡云数据科技有限公司 File system fragmentation method and device
CN111444117B (en) * 2020-03-23 2022-10-21 Oppo广东移动通信有限公司 Method and device for realizing fragmentation of storage space, storage medium and electronic equipment
US20220066991A1 (en) * 2020-09-02 2022-03-03 Micro Focus Llc Command line utility to generate user-controlled fragmentated test data on a hard disk drive
CN114238249B (en) * 2022-02-25 2022-05-10 成都鲁易科技有限公司 File system aging evaluation method and device, storage medium and terminal

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5987479A (en) * 1997-09-24 1999-11-16 Sony Corporation, Inc. Large block allocation for disk-based file systems
CN1975935A (en) * 2006-12-15 2007-06-06 北京中星微电子有限公司 External storing performance testing method and apparatus
CN103198102A (en) * 2013-03-20 2013-07-10 广东欧珀移动通信有限公司 Transfer method and device of Android equipment internal hard disk file system
CN104156173A (en) * 2014-07-29 2014-11-19 浪潮(北京)电子信息产业有限公司 Method and device for disk defragmentation
CN105304140A (en) * 2014-06-13 2016-02-03 北京安兔兔科技有限公司 Method and apparatus for testing memory performance of electronic equipment
CN105373487A (en) * 2015-12-16 2016-03-02 浪潮(北京)电子信息产业有限公司 Defragmentation method and system for storage operation system
CN105589812A (en) * 2015-12-16 2016-05-18 成都华为技术有限公司 Disk defragmentation method, disk defragmentation device and host
CN108595323A (en) * 2018-03-30 2018-09-28 华为技术有限公司 A kind of system detection method and relevant apparatus
CN109542701A (en) * 2018-11-19 2019-03-29 郑州云海信息技术有限公司 A kind of disk performance test method and device

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU6081200A (en) * 1999-07-09 2001-01-30 Eric D. Schneider Optimized disk storage defragmentation with swapping capabilities
US7089354B2 (en) * 2003-07-30 2006-08-08 International Business Machines Corporation Disk fragmentation test system
US20070226445A1 (en) * 2006-03-22 2007-09-27 Tony Nichols Method and system for rapid data-fragmentation analysis of a file-allocation-table (FAT) file system
CN103123645A (en) * 2012-11-28 2013-05-29 无锡港湾网络科技有限公司 Method for reducing disk fragments
US9865360B2 (en) * 2015-10-22 2018-01-09 Sandisk Technologies Llc Burn-in memory testing
WO2017107015A1 (en) * 2015-12-21 2017-06-29 华为技术有限公司 Storage space allocation method, and storage device
CN106469120A (en) * 2016-08-30 2017-03-01 华为技术有限公司 Scrap cleaning method, device and equipment
US10579284B2 (en) * 2017-06-02 2020-03-03 International Business Machines Corporation Filesystem enhancements for unified file and object access in an object storage cloud

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5987479A (en) * 1997-09-24 1999-11-16 Sony Corporation, Inc. Large block allocation for disk-based file systems
CN1975935A (en) * 2006-12-15 2007-06-06 北京中星微电子有限公司 External storing performance testing method and apparatus
CN103198102A (en) * 2013-03-20 2013-07-10 广东欧珀移动通信有限公司 Transfer method and device of Android equipment internal hard disk file system
CN105304140A (en) * 2014-06-13 2016-02-03 北京安兔兔科技有限公司 Method and apparatus for testing memory performance of electronic equipment
CN104156173A (en) * 2014-07-29 2014-11-19 浪潮(北京)电子信息产业有限公司 Method and device for disk defragmentation
CN105373487A (en) * 2015-12-16 2016-03-02 浪潮(北京)电子信息产业有限公司 Defragmentation method and system for storage operation system
CN105589812A (en) * 2015-12-16 2016-05-18 成都华为技术有限公司 Disk defragmentation method, disk defragmentation device and host
CN108595323A (en) * 2018-03-30 2018-09-28 华为技术有限公司 A kind of system detection method and relevant apparatus
CN109542701A (en) * 2018-11-19 2019-03-29 郑州云海信息技术有限公司 A kind of disk performance test method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
一种卫星数据广播系统端站存储管理方案设计;高振华等;《电子制作》;20170701(第13期);86-89 *

Also Published As

Publication number Publication date
CN110221781A (en) 2019-09-10

Similar Documents

Publication Publication Date Title
CN110221781B (en) Manufacturing method and device of disk fragments, storage medium and intelligent terminal
US11397590B2 (en) Method for preloading application, storage medium, and terminal
EP3575962A1 (en) Method and device for preloading application, storage medium and intelligent terminal
EP3502878B1 (en) Method for preloading application and terminal device
CN110955631B (en) File access tracking method and device, storage medium and terminal
WO2019227994A1 (en) Method and apparatus for updating application prediction model, storage medium, and terminal
CN105740078B (en) Memory management method, device and terminal
CN112734498B (en) Task rewarding acquisition method, device, terminal and storage medium
US11138956B2 (en) Method for controlling display of terminal, storage medium, and electronic device
CN110222288B (en) Page display method, device and storage medium
EP3964973A1 (en) File loading method and apparatus, electronic device, and storage medium
CN108646962B (en) Editing method and device for terminal desktop layout, storage medium and mobile terminal
CN108875046A (en) A kind of storage system access method, device and electronic equipment
CN104699408A (en) Operation method and device of touch screen and touch device
CN110413413A (en) A kind of method for writing data, device, equipment and storage medium
US10228849B2 (en) Method and device for providing controller
CN112148226A (en) Data storage method and related device
CN105549847A (en) Picture displaying method of song playing interface and user terminal
CN113625973A (en) Data writing method and device, electronic equipment and computer readable storage medium
CN114579055B (en) Disk storage method, device, equipment and medium
CN109597707A (en) Clone volume data copying method, device and computer readable storage medium
CN109462777B (en) Video heat updating method, device, terminal and storage medium
CN106980447B (en) Information processing method and device and terminal
CN106156038B (en) Date storage method and device
CN111158595B (en) Enterprise-level heterogeneous storage resource scheduling method and 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