CN114356224B - File address optimization method, terminal, server and computer readable storage medium - Google Patents

File address optimization method, terminal, server and computer readable storage medium Download PDF

Info

Publication number
CN114356224B
CN114356224B CN202111545878.XA CN202111545878A CN114356224B CN 114356224 B CN114356224 B CN 114356224B CN 202111545878 A CN202111545878 A CN 202111545878A CN 114356224 B CN114356224 B CN 114356224B
Authority
CN
China
Prior art keywords
file
terminal
address
server
sorted
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
CN202111545878.XA
Other languages
Chinese (zh)
Other versions
CN114356224A (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.)
Guangzhou Zhicun Technology Co ltd
Original Assignee
Guangzhou Zhicun Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Zhicun Technology Co ltd filed Critical Guangzhou Zhicun Technology Co ltd
Priority to CN202111545878.XA priority Critical patent/CN114356224B/en
Publication of CN114356224A publication Critical patent/CN114356224A/en
Application granted granted Critical
Publication of CN114356224B publication Critical patent/CN114356224B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a file address optimization method, a terminal, a server and a computer readable storage medium, wherein the method comprises the following steps: when a file arrangement instruction sent by a server is received, determining a current address corresponding to a file to be arranged according to the file arrangement instruction; determining a target physical block corresponding to a file to be sorted, wherein the target physical block comprises the same physical block and/or a plurality of adjacent physical blocks; and modifying the physical address corresponding to the file to be sorted into the physical address of the target physical block. The invention reduces the complexity of file address optimization.

Description

File address optimization method, terminal, server and computer readable storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a file address optimization method, a terminal, a server, and a computer readable storage medium.
Background
The reason for the terminal blocking is mainly that temporary files are frequently written or deleted on the terminal, so that a plurality of large files are stored in discontinuous physical blocks to form fragmentation distribution. The existing method for performing disk arrangement on the terminal by the server usually comprises the steps of firstly obtaining a file to be arranged of the terminal, and then rewriting the file to be arranged to the terminal.
Disclosure of Invention
The embodiment of the invention aims to solve the technical problem of how to reduce the complexity of file address optimization by providing a file address optimization method, a terminal, a server and a computer readable storage medium.
The embodiment of the invention provides a file address optimization method, wherein a terminal is in communication connection with a server, and the file address optimization method comprises the following steps:
When a file arrangement instruction sent by a server is received, determining a current address corresponding to a file to be arranged according to the file arrangement instruction;
determining a target physical block corresponding to the file to be sorted, wherein the target physical block comprises the same physical block and/or a plurality of adjacent physical blocks;
And modifying the physical address corresponding to the file to be sorted into the physical address of the target physical block.
In an embodiment, before the step of determining the current address corresponding to the file to be sorted according to the file sorting instruction when the file sorting instruction sent by the server is received, the method further includes:
And when a file reading request sent by a server is received, sending a response result allowing reading of the local file to the server, so that the server sends the file sorting instruction.
In an embodiment, before the step of determining the target physical block corresponding to the file to be sorted, the method further includes:
And executing a garbage collection instruction to form the target physical block.
In one embodiment, the method is applied to a server, the server is in communication connection with a terminal, and the file address optimization method comprises the following steps:
acquiring a current address corresponding to a file to be sorted, wherein the file to be sorted is stored in a terminal;
And sending a file sorting instruction to the terminal according to the current address corresponding to the file to be sorted, so that the terminal performs address optimization on the file to be sorted according to the current address corresponding to the file to be sorted.
In an embodiment, the step of obtaining the current address corresponding to the file to be sorted includes:
Sending a file reading request to the terminal, so that the terminal responds to the file reading finger request and sends a response result allowing reading of the local file;
When receiving a response result which is sent by the terminal and allows the local file to be read, acquiring a current address corresponding to the local file of the terminal;
And determining the current address corresponding to the file to be sorted according to the current address corresponding to the local file.
In an embodiment, the step of determining the current address corresponding to the file to be consolidated according to the current address corresponding to the local file includes:
Acquiring the reading speed of the sub-file in the local file;
Determining the files to be sorted in the subfiles according to the reading speed;
and acquiring the current address corresponding to the file to be sorted.
In an embodiment, the step of obtaining the current address corresponding to the file to be sorted includes:
and determining the current address corresponding to the file to be sorted according to a preset file storage list.
In an embodiment, before the step of determining the remaining capacity of the target battery in the battery pack, the method further includes:
Determining a fault condition of the target battery;
The embodiment of the invention also provides a terminal, which comprises: the system comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor realizes the steps of the file address optimization method when executing the computer program.
The embodiment of the invention also provides a server, which comprises: the system comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor realizes the steps of the file address optimization method when executing the computer program.
Embodiments of the present invention also provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the file address optimization method as described above.
In the technical scheme of the embodiment, when a terminal receives a file arrangement instruction sent by a server, the terminal determines a current address corresponding to a file to be arranged according to the file arrangement instruction; determining a target physical block corresponding to the file to be sorted, wherein the target physical block comprises the same physical block and/or a plurality of adjacent physical blocks; and modifying the physical address corresponding to the file to be sorted into the physical address of the target physical block. Because the terminal is in communication connection with the server, when the file arrangement instruction sent by the server is received, the address of the file to be arranged can be optimized based on the file arrangement instruction, the server is not required to rewrite the file to be arranged, the read-write speed of the file to be arranged can be improved, and the complexity of file address optimization is reduced.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic diagram of a hardware architecture of a terminal according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a hardware architecture of a server according to an embodiment of the present invention;
FIG. 3 is a flowchart of a first embodiment of a method for optimizing a file address according to the present invention;
FIG. 3A is a reference diagram of a first embodiment of a file address optimization method according to the present invention;
FIG. 3B is a reference diagram of a first embodiment of a file address optimization method according to the present invention;
FIG. 3C is a reference diagram of a first embodiment of a file address optimization method according to the present invention;
FIG. 4 is a flowchart of a second embodiment of the file address optimization method of the present invention;
FIG. 5 is a flowchart of a third embodiment of a file address optimization method according to the present invention;
FIG. 6 is a flowchart of a fourth embodiment of a file address optimization method according to the present invention;
FIG. 7 is a detailed flowchart of step S210 of the fifth embodiment of the file address optimization method of the present invention;
FIG. 8 is a detailed flowchart of step S211 of a sixth embodiment of the file address optimization method according to the present invention;
fig. 9 is a flowchart of a file address optimization method according to a seventh embodiment of the present invention.
Detailed Description
In order that the above-described aspects may be better understood, exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
The main solution of the invention is as follows: when a terminal receives a file arrangement instruction sent by a server, determining a current address corresponding to a file to be arranged according to the file arrangement instruction; determining a target physical block corresponding to the file to be sorted, wherein the target physical block comprises the same physical block and/or a plurality of adjacent physical blocks; and modifying the physical address corresponding to the file to be sorted into the physical address of the target physical block.
Because the terminal is in communication connection with the server, when the file arrangement instruction sent by the server is received, the address of the file to be arranged can be optimized based on the file arrangement instruction, the server is not required to rewrite the file to be arranged, the read-write speed of the file to be arranged can be improved, and the complexity of file address optimization is reduced.
As an implementation, the terminal may be as in fig. 1.
The embodiment of the invention relates to a terminal, which comprises: a processor 101, such as a CPU, a memory 102, and a communication bus 103. Wherein the communication bus 103 is used to enable connected communication among the components.
Memory 102 may be a variety of solid state storage devices with NAND FLASH as storage media. As shown in fig. 1, a detection program may be included in a memory 102 as a computer-readable storage medium; and the processor 101 may be configured to call the detection program stored in the memory 102 and perform the following operations:
When a file arrangement instruction sent by a server is received, determining a current address corresponding to a file to be arranged according to the file arrangement instruction;
determining a target physical block corresponding to the file to be sorted, wherein the target physical block comprises the same physical block and/or a plurality of adjacent physical blocks;
And modifying the physical address corresponding to the file to be sorted into the physical address of the target physical block.
In one embodiment, the processor 101 may be configured to call a detection program stored in the memory 102 and perform the following operations:
And when a file reading request sent by a server is received, sending a response result allowing reading of the local file to the server, so that the server sends the file sorting instruction.
In one embodiment, the processor 101 may be configured to call a detection program stored in the memory 102 and perform the following operations:
And executing a garbage collection instruction to form the target physical block.
In the technical scheme of the embodiment, when a terminal receives a file arrangement instruction sent by a server, the terminal determines a current address corresponding to a file to be arranged according to the file arrangement instruction; determining a target physical block corresponding to the file to be sorted, wherein the target physical block comprises the same physical block and/or a plurality of adjacent physical blocks; and modifying the physical address corresponding to the file to be sorted into the physical address of the target physical block. Because the terminal is in communication connection with the server, when the file arrangement instruction sent by the server is received, the address of the file to be arranged can be optimized based on the file arrangement instruction, the server is not required to rewrite the file to be arranged, the read-write speed of the file to be arranged can be improved, and the complexity of file address optimization is reduced.
As an implementation, the server may be as in fig. 2.
The embodiment of the invention relates to a server, which comprises: a processor 201, such as a CPU, a memory 202, and a communication bus 203. Wherein the communication bus 203 is used to enable the connected communication between these components.
Memory 202 may be a variety of solid state storage devices with NAND FLASH as storage media. As shown in fig. 2, a detection program may be included in a memory 202 as a computer-readable storage medium; and the processor 201 may be configured to call the detection program stored in the memory 202 and perform the following operations:
acquiring a current address corresponding to a file to be sorted, wherein the file to be sorted is stored in a terminal;
And sending a file sorting instruction to the terminal according to the current address corresponding to the file to be sorted, so that the terminal performs address optimization on the file to be sorted according to the current address corresponding to the file to be sorted.
In one embodiment, the processor 201 may be configured to call a detection program stored in the memory 202 and perform the following operations:
acquiring a current address corresponding to a file to be sorted, wherein the file to be sorted is stored in a terminal;
And sending a file sorting instruction to the terminal according to the current address corresponding to the file to be sorted, so that the terminal performs address optimization on the file to be sorted according to the current address corresponding to the file to be sorted.
In one embodiment, the processor 201 may be configured to call a detection program stored in the memory 202 and perform the following operations:
Sending a file reading request to the terminal, so that the terminal responds to the file reading finger request and sends a response result allowing reading of the local file;
When receiving a response result which is sent by the terminal and allows the local file to be read, acquiring a current address corresponding to the local file of the terminal;
And determining the current address corresponding to the file to be sorted according to the current address corresponding to the local file.
In one embodiment, the processor 201 may be configured to call a detection program stored in the memory 202 and perform the following operations:
Acquiring the reading speed of the sub-file in the local file;
Determining the files to be sorted in the subfiles according to the reading speed;
and acquiring the current address corresponding to the file to be sorted.
In one embodiment, the processor 201 may be configured to call a detection program stored in the memory 202 and perform the following operations:
and determining the current address corresponding to the file to be sorted according to a preset file storage list.
In the technical scheme of the embodiment, a server acquires a current address corresponding to a file to be sorted, and the file to be sorted is stored in a terminal; and sending a file sorting instruction to the terminal according to the current address corresponding to the file to be sorted, so that the terminal performs address optimization on the file to be sorted according to the current address corresponding to the file to be sorted. The server is in communication connection with the terminal, so that the current address corresponding to the file to be sorted can be obtained, a file sorting instruction can be sent to the terminal based on the obtained current address of the file to be sorted, the file of the terminal is not required to be obtained for rewriting, and the complexity of file address optimization is reduced.
In order to better understand the above technical solutions, the following detailed description will refer to the accompanying drawings and specific embodiments.
Referring to fig. 3, fig. 3 is a first embodiment of the file address optimizing method of the present invention, the method includes the following steps:
Step S110, when a file arrangement instruction sent by a server is received, determining a current address corresponding to a file to be arranged according to the file arrangement instruction.
In this embodiment, the server is configured to maintain a terminal, where the terminal is in communication connection with the server, and the server has authority to send an instruction to the terminal, where the file sort instruction is configured to instruct the terminal to move a file to be sorted, which is stored in a fragmentation manner, to the same physical block or multiple adjacent physical blocks, where the file to be sorted in a fragmentation manner may be understood as a disk fragment or a file fragment, because the file is stored in a dispersed manner in a different place of the entire disk, instead of being continuously stored in a cluster formed by continuously storing the file in a disk. After the hard disk is used for a period of time, because the file is repeatedly written and deleted, the idle sectors in the disk can be scattered to discontinuous physical positions in the whole disk, so that the file cannot exist in continuous sectors. Therefore, when the file is read and written again, the file needs to be read in different places, the back and forth movement of the magnetic head is increased, and the access speed of the magnetic disk is reduced.
Alternatively, the file sort command is a private command sent from the server to the terminal through a Small Computer System Interface (SCSI), which is an independent processor standard for a system-level interface between the Computer and its peripheral devices (hard disk, floppy disk drive, optical drive, printer, scanner, etc.). The SCSI standard defines the electrical characteristics of commands, communication protocols, and entities (in terms of OSI, occupying the physical, link, socket, application layers), most of which are applied to storage devices (e.g., hard disk, tape drive); however, in practice, SCSI may be connected to devices including scanners, optical devices (such as cds, dvds), printers … …, etc., and SCSI commands list supported SCSI peripherals. SCSI-1 is the most primitive version, with asynchronous transmissions at 3MB/S and synchronous transmissions at 5MB/S. Although almost eliminated, 25-pin interfaces are employed in some scanners and internal ZIP drives. That is, if a SCSI-1 device is coupled to your SCSI card, there must be an internal 25-pin interface cable; if an external device is used, any of the internal interfaces cannot be used (i.e., none of the internal interfaces is usable at this time). Early SCSI-2, called FastSCSI, can connect 7 peripherals by increasing the synchronous transmission frequency to increase the data transmission rate from original 5MB/s to 10MB/s, supporting 8-bit parallel data transmission. And WideSCSI which appears later supports 16-bit parallel data transmission, the data transmission rate is also improved to 20MB/s, and 16 peripherals can be connected. The SCSI version uses a 50 pin interface, mainly for scanners, CD-ROM drives, and old hard drives. In 1995, a higher speed SCSI-3, called UltraSCSI, was created, and the data transfer rate also reached 20MB/s. It improves the synchronous transmission clock frequency to 20MB/s, and improves the data transmission rate. If the 16-bit transmission Wide mode is used, the data transmission rate can be further improved to 40MB/s. This version of SCSI uses a 68 pin interface, primarily for hard disk applications. The typical feature of SCSI-3 is to greatly increase the bus frequency and reduce signal interference, thereby enhancing its stability. SCSI-3 is preferred in this embodiment.
Step S120, determining a target physical block corresponding to the file to be sorted, where the target physical block includes the same physical block and/or a plurality of adjacent physical blocks.
In this embodiment, the target physical block is used to store the file to be sorted.
Optionally, after determining the file to be sorted, the target physical block may be determined based on the size of the data amount of the file to be sorted, where the file to be sorted is preferentially stored in the same physical block or multiple adjacent physical blocks.
Step S130, modifying the physical address corresponding to the file to be sorted into the physical address of the target physical block.
In this embodiment, modifying the physical address corresponding to the file to be sorted into the physical address of the target physical block is address optimization, and only the physical address corresponding to the file to be sorted needs to be changed, the logical address is not changed, and the server side can still read the file to be sorted stored in the terminal based on the previously stored logical address.
Optionally, referring to fig. 3A, the overall system framework involved in the file address optimization method mainly involves the following layers:
1. Upper layer application software;
2. OS file system management software and hardware communication bus;
3. a solid state storage device master control;
4、4Nand Flash。
Specifically, when the upper layer application software and the OS file system manage to read and write files, the files are operated through an API interface provided by the processor. The method for reading and writing the file is characterized by being simple and convenient, but cannot control the system to store the specified data in the specified logical address. Nevertheless, some software may do bus-level-based operations directly by calling the read-write command API provided by the OS. The read-write command is based on various communication buses such as USB, SATA, PCIE for data interaction. These commands conform to the SCSI protocol standard. The feature is that these commands explicitly mark the logical address and data length of the write. What is a logical address: the logical address is the address provided by the storage device to the Host for managing data distribution, and is transmitted when the SCSI read-write command interaction is performed. The 4Nand Flash is a storage device in the terminal of the embodiment, and generally comprises a storage control chip (namely a main control chip) and a plurality of NAND FLASH, NAND FLASH storage media used for the storage device, and has the characteristic of being difficult to lose when power is cut off. Therefore, after the master control receives the data with the designated logical address, the corresponding data is written to a specific position NAND FLASH for storage through an algorithm management called FTL. The command used at this time is NAND FLASH read/write command, and the address used is NAND FLASH address.
When software performs a file writing operation, many times, the software cannot control the address of the data writing when the software directly calls the file system API provided by the server. When some software needs to save files with larger data volume, the provided API is called to save the data, and the OS uses continuous large data transmission to save the data to continuous logic addresses at the beginning. Generally, at this time, the solid state disk also stores the data to the continuous NAND FLASH addresses after the FTL is converted due to the continuous large data command received. However, with the use of the hard disk, the hard disk is also written with a lot of small data scattered, and Garbage Collection (GC) is started when the hard disk is to be fully written. When garbage collection is performed, such continuous data is likely to be scattered due to its collection mechanism. Although the contiguous data is broken up in NAND FLASH at this time, the addresses remain contiguous as viewed from the logical address by the Host due to the FTL's logical address to NAND FLASH address mapping management.
This has a problem in that if the data is discontinuous in NAND FLASH, the read performance of the data will be affected. It is obvious that, for example, games can be significantly slowed down when they are loaded with large resources. And the operating system has no way at this time because it is continuous from a logical address, and it is not consolidated even with the defragmentation function.
Therefore, how to solve the problem of slow reading performance of a large file which is written once but stored for a long period of time is the main intention of the present embodiment.
Optionally, referring to fig. 3B, fig. 3B is a schematic flow chart of the file address optimization method in this embodiment:
1. The SCSI protocol has provisions that allow vendors to define proprietary commands themselves, in addition to public commands. The proprietary command format and usage can be fully custom, so we use custom proprietary commands here to inform the storage device to turn on and off file address optimization functions.
2. The reason why the device needs to be informed of the file address optimization to be turned on and off is that the logical addresses of file storage are not known based on the operating software at the file system level, so that the software can only record and read the logical addresses by the storage device itself by sending the read file again. After the end command is sent, the device starts the address optimization operation of the file, and the data of the logical address used by the read command sent by the system in the period is sorted to the position with continuous address in NAND FLASH by GC, namely, only the physical address corresponding to the file to be sorted needs to be changed.
3. A SCSI command communication is divided into a command transmission stage, a data transmission stage and a command state transmission stage. In the above flow chart, three private commands are included, which are:
The file address acquisition is started;
Ending the file address acquisition;
Acquiring a file address optimization state;
The two private commands, namely the file address acquisition start command and the file address acquisition end command, do not pay attention to the data transmission stage, namely any data transmission or no data transmission, and are not listed in the above figure. And the file address optimizing state is acquired, and the storage device of the terminal needs to return to the current state in the data transmission stage.
Optionally, referring to fig. 3C, another flow chart of the file address optimization method of the present embodiment is shown:
If the server can acquire the logical address of the file to be sorted, the logical address of the file to be sorted can be sorted into a table, and then the table is notified to the terminal. Therefore, the time for reading the files to be tidied once again can be saved, and the process is simplified to a certain extent.
In the technical scheme of the embodiment, the terminal is in communication connection with the server, so that when a file arrangement instruction sent by the server is received, the file to be arranged can be subjected to address optimization based on the file arrangement instruction, the server is not required to rewrite the file to be arranged, the read-write speed of the file to be arranged can be improved, and the complexity of file address optimization is reduced.
Referring to fig. 4, fig. 4 is a second embodiment of the file address optimizing method according to the present invention, based on the first embodiment, before step S110, including:
step S140, when a file reading request sent by a server is received, sending a response result allowing to read a local file to the server, so that the server sends the file sort instruction.
In this embodiment, when detecting a file reading request sent by the server, the terminal responds to the request, so that the server determines the current address of the file to be sorted by reading the local file, thereby realizing file address optimization.
In the technical scheme of the embodiment, the address of the local file is transferred to the server in a mode of allowing the server to read the local file, only the access authority is required to be controlled, the address of the local file is not required to be counted and sent to the server, and the computing power resource of the terminal is saved.
Referring to fig. 5, fig. 5 is a third embodiment of the file address optimizing method according to the present invention, and before step S120, further includes:
Step S150, executing a garbage collection instruction to form the target physical block.
In the technical solution of this embodiment, when the terminal is to move the file to be sorted to the same physical block or a plurality of adjacent physical blocks, the garbage collection operation may be performed first, so that a blank physical block is vacated, so that the file to be sorted obtains the best quality of storage space.
Referring to fig. 6, fig. 6 is a fourth embodiment of a file address optimizing method according to the present invention, based on any one of the first to third embodiments, further including:
step S210, a current address corresponding to a file to be sorted is obtained, and the file to be sorted is stored in a terminal.
Step S220, a file arrangement instruction is sent to the terminal according to the current address corresponding to the file to be arranged, so that the terminal performs address optimization on the file to be arranged according to the current address corresponding to the file to be arranged.
In the technical scheme of the embodiment, the server is in communication connection with the terminal, so that the current address corresponding to the file to be sorted can be obtained, a file sorting instruction can be sent to the terminal based on the obtained current address of the file to be sorted, file address optimization can be completed without obtaining the file of the terminal and rewriting the file, and the complexity of file address optimization is reduced.
Referring to fig. 7, fig. 7 is a fifth embodiment of a file address optimizing method according to the present invention, based on any one of the first to fourth embodiments, step S210 includes:
step S211, a file reading request is sent to the terminal, so that the terminal responds to the file reading finger request and sends a response result of allowing reading of the local file.
Step S212, when receiving a response result sent by the terminal and allowing the local file to be read, acquiring a current address corresponding to the local file of the terminal.
Step S213, determining the current address corresponding to the file to be sorted according to the current address corresponding to the local file.
In the technical scheme of the embodiment, the server can acquire the current address of the local file stored by the terminal by accessing or reading the file of the terminal, so that the address of the file to be tidied is determined based on the acquired address, the terminal only needs to respond to the file reading request of the server, and the file tidying pressure of the terminal is reduced.
Referring to fig. 8, fig. 8 is a sixth embodiment of a file address optimizing method according to the present invention, based on any one of the first to fifth embodiments, step S211 includes:
Step S2111, obtaining the reading speed of the sub-file in the local file.
In this embodiment, the above-mentioned reading speed is a time length corresponding to a reading target recorded by the server when reading any one of the local files in the terminal.
Step S2112, determining the file to be sorted in the subfiles according to the reading speed.
In this embodiment, a local file stored in a terminal with a slow reading speed is used as a file to be sorted.
Step S2113, the current address corresponding to the file to be sorted is obtained.
In the technical scheme of the embodiment, when the server reads the local file of the terminal, the server can record the reading speed of each reading target, and then define the local file stored in the terminal with low reading speed as the file to be tidied, so that the terminal tidies the file without manually defining the file to be tidied, and the file tidying efficiency is improved.
Referring to fig. 9, fig. 9 is a seventh embodiment of a file address optimizing method according to the present invention, and based on any one of the first to sixth embodiments, step S210 includes:
step S214, determining the current address corresponding to the file to be sorted according to a preset file storage list.
In this embodiment, the preset file storage list records a logical address and/or a physical address of the terminal, and the server may directly send the address of the file to be sorted to the terminal based on the file storage list, where when the terminal receives the address in the file sorting instruction, the terminal sorts the local file corresponding to the address as the file to be sorted by default.
In the technical scheme of the embodiment, the files to be sorted are determined based on the pre-stored file storage list, when the terminals need to be fragmented files to be sorted, the server does not need to acquire the storage addresses of the local files from the terminals, the addresses of the files to be sorted can be obtained based on the pre-set file storage list, and then the files are used for optimizing the file addresses, so that the terminal pressure is reduced, and meanwhile, the file sorting speed is improved.
In order to achieve the above object, an embodiment of the present invention further provides a terminal, including: the system comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor realizes the steps of the file address optimization method when executing the computer program.
To achieve the above object, an embodiment of the present invention further provides a server, including: the system comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor realizes the steps of the file address optimization method when executing the computer program.
To achieve the above object, embodiments of the present invention also provide a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the file address optimization method as described above.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program embodied on one or more computer-usable computer-readable storage media having computer-usable program code embodied therein, including but not limited to, solid-state memory devices of the type NAND FLASH storage medium.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, terminals, servers (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It should be noted that in the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The use of the words first, second, third, etc. do not denote any order. These words may be interpreted as names.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present invention without departing from the spirit or scope of the invention. Thus, it is intended that the present invention also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.

Claims (5)

1. The file address optimization method is characterized by being applied to a terminal, wherein the terminal is in communication connection with a server, and the file address optimization method comprises the following steps of:
when a file reading request sent by a server is received, sending a response result allowing to read a local file to the server, so that the server sends a file sorting instruction, and forwarding the address of the local file to the server in a mode allowing the server to read the local file, so that the address of the local file is not required to be counted and sent to the server, and the computing power resource of the terminal is saved;
when a file sorting instruction sent by the server is received, determining a current address corresponding to a file to be sorted according to the file sorting instruction, wherein the file sorting instruction is used for indicating the terminal to move the file to be sorted stored in a fragmentation manner to the same physical block or a plurality of adjacent physical blocks;
executing a garbage collection instruction to form a target physical block so as to obtain the best quality storage space of the files to be sorted;
Determining the target physical block corresponding to the file to be sorted, wherein the target physical block comprises the same physical block and/or a plurality of adjacent physical blocks;
And sorting the physical address corresponding to the file to be sorted into the physical address of the target physical block through a garbage recycling process.
2. The file address optimization method is characterized by being applied to a server, wherein the server is in communication connection with a terminal, and the file address optimization method comprises the following steps of:
sending a file reading request to a terminal, so that the terminal responds to the file reading request and sends a response result allowing reading of a local file;
When receiving a response result which is sent by the terminal and allows the local file to be read, acquiring a current logic address corresponding to the local file of the terminal;
acquiring the reading speed of the sub-files in the local file, and defining the local file stored in the terminal with slow reading speed as a file to be sorted;
Determining a current logic address corresponding to the file to be sorted according to a preset file storage list, wherein the preset file storage list records the logic address and the physical address of the terminal;
And sending a file sorting instruction to the terminal according to the current address corresponding to the file to be sorted, so that the terminal performs address optimization on the file to be sorted according to the current address corresponding to the file to be sorted.
3. A terminal, the terminal comprising: memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the file address optimization method according to claim 1 when the computer program is executed.
4. A server, the server comprising: memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the file address optimization method according to claim 2 when the computer program is executed.
5. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of the file address optimization method according to any of claims 1 to 2.
CN202111545878.XA 2021-12-15 2021-12-15 File address optimization method, terminal, server and computer readable storage medium Active CN114356224B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111545878.XA CN114356224B (en) 2021-12-15 2021-12-15 File address optimization method, terminal, server and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111545878.XA CN114356224B (en) 2021-12-15 2021-12-15 File address optimization method, terminal, server and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN114356224A CN114356224A (en) 2022-04-15
CN114356224B true CN114356224B (en) 2024-04-19

Family

ID=81099827

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111545878.XA Active CN114356224B (en) 2021-12-15 2021-12-15 File address optimization method, terminal, server and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN114356224B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1677367A (en) * 2004-03-29 2005-10-05 东芝解决方案株式会社 Storage system and method for controlling block rearrangement
CN105190526A (en) * 2013-02-08 2015-12-23 微软技术许可有限责任公司 Readdressing memory for non-volatile storage devices
CN105637491A (en) * 2014-09-26 2016-06-01 华为技术有限公司 File migration method and apparatus and storage device
CN107704507A (en) * 2017-08-31 2018-02-16 三星电子(中国)研发中心 Data base processing method and equipment
US10776317B1 (en) * 2015-03-31 2020-09-15 EMC IP Holding Company LLC Metadata analytics for online fragmentation detection on Unix file systems and common block file systems
CN112445766A (en) * 2019-08-31 2021-03-05 华为技术有限公司 Terminal fragment sorting method and device and terminal
CN112732198A (en) * 2021-01-15 2021-04-30 广州Tcl互联网小额贷款有限公司 File management method, device, equipment and storage medium
CN113609082A (en) * 2021-06-25 2021-11-05 苏州浪潮智能科技有限公司 File system defragmentation method, device and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016112957A1 (en) * 2015-01-13 2016-07-21 Hitachi Data Systems Engineering UK Limited Computer program product, method, apparatus and data storage system for managing defragmentation in file systems
CN110245119B (en) * 2018-11-02 2023-01-31 浙江大华技术股份有限公司 File sorting method and storage system

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1677367A (en) * 2004-03-29 2005-10-05 东芝解决方案株式会社 Storage system and method for controlling block rearrangement
CN105190526A (en) * 2013-02-08 2015-12-23 微软技术许可有限责任公司 Readdressing memory for non-volatile storage devices
CN105637491A (en) * 2014-09-26 2016-06-01 华为技术有限公司 File migration method and apparatus and storage device
US10776317B1 (en) * 2015-03-31 2020-09-15 EMC IP Holding Company LLC Metadata analytics for online fragmentation detection on Unix file systems and common block file systems
CN107704507A (en) * 2017-08-31 2018-02-16 三星电子(中国)研发中心 Data base processing method and equipment
CN112445766A (en) * 2019-08-31 2021-03-05 华为技术有限公司 Terminal fragment sorting method and device and terminal
CN112732198A (en) * 2021-01-15 2021-04-30 广州Tcl互联网小额贷款有限公司 File management method, device, equipment and storage medium
CN113609082A (en) * 2021-06-25 2021-11-05 苏州浪潮智能科技有限公司 File system defragmentation method, device and storage medium

Also Published As

Publication number Publication date
CN114356224A (en) 2022-04-15

Similar Documents

Publication Publication Date Title
US8150890B2 (en) File system that manages files according to content
KR100951107B1 (en) Method for managing files for optimal performance
US7707337B2 (en) Object-based storage device with low process load and control method thereof
JP5955870B2 (en) Method, computer readable storage medium and system for optimal compression of a virtual disk
US8924659B2 (en) Performance improvement in flash memory accesses
CN101763437B (en) Method and device for realizing high-speed buffer storage
JP6011349B2 (en) Storage apparatus and data compression method
JP5314158B2 (en) Method and computer readable medium for prestaging data based on dynamic storage tiering configuration
US20090019223A1 (en) Method and systems for providing remote strage via a removable memory device
JP2011513805A (en) Select storage location for file storage based on storage life and speed
US9182912B2 (en) Method to allow storage cache acceleration when the slow tier is on independent controller
WO2010040255A1 (en) Method for managing object-based storage system
JP2009512033A (en) Data backup application emulation components
JP2011513823A (en) Extended usage range for memory devices
JP2009181148A (en) Storage subsystem
US10585589B2 (en) Data collation method, storage device, storage controller, and storage array
WO2012171434A1 (en) Method and device for finding files or folders
WO2021073635A1 (en) Data storage method and device
US20230306010A1 (en) Optimizing Storage System Performance Using Data Characteristics
WO2021027541A1 (en) Data deduplication method and apparatus
CN110795386B (en) Data writing method and server
KR20090031102A (en) Method and apparatus for formatting for a potable storage device
CN114356224B (en) File address optimization method, terminal, server and computer readable storage medium
WO2023040305A1 (en) Data backup system and apparatus
CN114416656A (en) Method, equipment and storage medium for remotely operating folder

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