CN117407364A - Disk space management method, device, equipment and storage medium - Google Patents

Disk space management method, device, equipment and storage medium Download PDF

Info

Publication number
CN117407364A
CN117407364A CN202210803136.0A CN202210803136A CN117407364A CN 117407364 A CN117407364 A CN 117407364A CN 202210803136 A CN202210803136 A CN 202210803136A CN 117407364 A CN117407364 A CN 117407364A
Authority
CN
China
Prior art keywords
disk space
file
files
files stored
management
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210803136.0A
Other languages
Chinese (zh)
Inventor
段宇飞
张兴华
冉然
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Zitiao Network Technology Co Ltd
Original Assignee
Beijing Zitiao Network 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 Beijing Zitiao Network Technology Co Ltd filed Critical Beijing Zitiao Network Technology Co Ltd
Priority to CN202210803136.0A priority Critical patent/CN117407364A/en
Publication of CN117407364A publication Critical patent/CN117407364A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/162Delete operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present disclosure provides a method, an apparatus, a device, and a storage medium for managing a disk space. The management method of the disk space provided by the disclosure comprises the steps of firstly receiving a management protocol of the disk space sent by a server, wherein the management protocol of the disk space is used for managing files in the disk space; secondly, analyzing a management protocol of the disk space, and determining information of management rules of the disk space; thirdly, scanning the disk space and determining files stored in the disk space; and finally, deleting the target file in the files stored in the disk space according to the information of the management rule of the disk space. In this way, the management rules of the disk space can be updated in real time by the management protocol of the disk space, thereby managing all files in the disk space.

Description

Disk space management method, device, equipment and storage medium
Technical Field
The present disclosure relates to the field of data storage technologies, and in particular, to a method, an apparatus, a device, and a storage medium for managing a disk space.
Background
In the running process of the application program, the terminal equipment can acquire data resources from the server and store the data resources. With the continuous use of users, the occupation size of the application in the disk space of the terminal device is increased continuously. Therefore, for the management of the disk space, the occupation of the application program on the disk space can be monitored and recycled in time, and the usable space of the disk space is increased.
In the related art, the existing management method of the disk space can manage the cache files of the application program, such as log files, advertisement files, application setting parameters, etc., but cannot manage the user files for the user. The file management scope of the application is also determined when the application is installed, and new files generated in the future and useless files discarded in the future cannot be managed.
Therefore, the existing file management method cannot adjust the file management range in real time, and thus cannot manage all files in the disk space.
Disclosure of Invention
The disclosure provides a method, a device, equipment and a storage medium for managing a disk space, which are used for solving the technical problem that all files in the disk space cannot be managed.
In a first aspect, an embodiment of the present disclosure provides a method for managing disk space, including:
receiving a management protocol of the disk space sent by a server, wherein the management protocol of the disk space is used for managing files in the disk space;
analyzing the management protocol of the disk space and determining the information of the management rule of the disk space;
scanning the disk space and determining files stored in the disk space;
And deleting the target file in the files stored in the disk space according to the information of the management rule of the disk space.
In a second aspect, an embodiment of the present disclosure provides a management apparatus for disk space, including:
the receiving module is used for receiving a management protocol of the disk space sent by the server, wherein the management protocol of the disk space is used for managing files in the disk space;
the analysis module is used for analyzing the management protocol of the disk space and determining the information of the management rule of the disk space;
the scanning module is used for scanning the disk space and determining files stored in the disk space;
and the deleting module is used for deleting the target file in the files stored in the disk space according to the information of the management rule of the disk space.
In a third aspect, an embodiment of the present disclosure provides an electronic device, including:
a processor; and
a memory for storing a computer program;
wherein the processor is configured to implement the method of managing disk space as described in the first aspect and the various possible designs of the first aspect above by executing the computer program.
In a fourth aspect, embodiments of the present disclosure provide a computer-readable storage medium having stored therein computer-executable instructions that, when executed by a processor, implement a method of managing disk space as described in the first aspect and in the various possible designs of the first aspect.
In a fifth aspect, embodiments of the present disclosure provide a computer program product comprising a computer program which, when executed by a processor, implements the method of managing disk space as described in the first aspect and in the various possible designs of the first aspect.
The embodiment of the disclosure provides a method, a device, equipment and a storage medium for managing a disk space, which are used for firstly receiving a management protocol of the disk space sent by a server, wherein the management protocol of the disk space is used for managing files to be deleted in the disk space; secondly, analyzing a management protocol of the disk space, and determining information of management rules of the disk space; thirdly, scanning the disk space and determining files stored in the disk space; and finally, deleting the target file in the files stored in the disk space according to the information of the management rule of the disk space. In this way, the management rules of the disk space can be updated in real time by the management protocol of the disk space, thereby managing all files in the disk space.
Drawings
In order to more clearly illustrate the embodiments of the present disclosure or the solutions in the prior art, a brief description will be given below of the drawings that are needed in the embodiments or the description of the prior art, it being obvious that the drawings in the following description are some embodiments of the present disclosure, and that other drawings may be obtained from these drawings without inventive effort to a person of ordinary skill in the art.
Fig. 1 is an application scenario schematic diagram of a method for managing disk space according to an embodiment of the present disclosure;
fig. 2 is a flowchart of a method for managing disk space according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of a first interface of an application provided in an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of a second interface of an application provided in an embodiment of the present disclosure;
FIG. 5 is a schematic diagram of a third interface of an application provided in an embodiment of the present disclosure;
FIG. 6 is a schematic diagram of a management rule registration provided by an embodiment of the present disclosure;
FIG. 7 is a flowchart illustrating another method for managing disk space according to an embodiment of the present disclosure;
FIG. 8 is a flowchart illustrating a method for managing disk space according to another embodiment of the present disclosure;
FIG. 9 is a block diagram of a disk space management apparatus according to an embodiment of the present disclosure;
fig. 10 is a schematic structural view of an electronic device according to an example embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure have been shown in the accompanying drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments. Related definitions of other terms will be given in the description below.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The files in the disk space can be divided into a program core file, a cache file and a user file from the point of view of attribution of the files. The program core file is a file which can cause the application program to be unable to run after being deleted; the cache file is a file which is required to be generated by the normal operation of the application program, such as a log file, an advertisement file, an application setting parameter and the like; the user file is an intermediate file or a final file generated during use of the application program, such as a photograph, an editing draft, a video clip material, and the like.
From the application program use point of view, new use of new types of files will continuously appear, and the management scope should be included. Meanwhile, the currently useful file may be discarded and deleted. Thus, files in disk space can also be divided into files that are currently managed, files that need to be managed in the future, and files that have been used in the past but have been discarded.
In the related art, the existing management method of the disk space can manage the cache file of the application program, but cannot manage the user file for the user. The file management scope of the application is also determined when the application is installed, and new files generated in the future and useless files discarded in the future cannot be managed. Therefore, the existing file management method cannot adjust the file management range in real time, and thus cannot manage all files in the disk space.
In order to solve the above-mentioned problems, an embodiment of the present disclosure provides a method for managing a disk space, in which information of a management rule of the disk space is updated by sending a management protocol of the disk space, and then a target file in files stored in the disk space is deleted based on the information of the management rule of the disk space. Before obtaining information such as disk space information and user files, user authorization is required to be obtained, and subsequent related operations are executed after the user authorization. By the disk space management method, the management rule of the disk space can be adjusted in real time, so that all files in the disk space can be managed.
The following describes an application scenario of the disk space management method according to the present disclosure.
Fig. 1 is an application scenario schematic diagram of a method for managing disk space according to an embodiment of the present disclosure. As shown in fig. 1, the terminal device 101 may run an application program, and when the terminal device 101 needs to manage a disk space, a request may be sent to the server 102 to acquire the latest management protocol of the disk space. After receiving the management protocol of the disk space sent by the server 102, the terminal device 101 analyzes the information of the management rule of the disk space from the disk space management protocol, so as to delete the target file in the file stored in the disk space based on the information of the management rule of the disk space.
The terminal device 101 may be a device with a disk space, such as a tablet computer (pad), a computer with a wireless transceiving function, a Virtual Reality (VR) terminal device, an augmented reality (augmented reality, AR) terminal device, a wireless terminal in an industrial control (industrial control), a wireless terminal in a self driving (self driving), a wireless terminal in a teleoperation (remote medical surgery), a wireless terminal in a smart grid (smart grid), a wireless terminal in a smart home (smart home), or the like. In the embodiment of the disclosure, the device for implementing the function of the terminal may be the terminal, or may be a device capable of supporting the terminal to implement the function, for example, a chip system, and the device may be installed in the terminal. In the embodiments of the present disclosure, the chip system may be formed by a chip, and may also include a chip and other discrete devices.
Server 102 may be, but is not limited to, a single web server, a server group of multiple web servers, or a cloud based cloud computing consisting of a large number of computers or web servers. The cloud computing is a distributed computing type, and is a super virtual computer consisting of a group of loosely coupled computers.
It should be understood that the application scenario of the technical solution of the present disclosure may be the scenario in fig. 1, but is not limited thereto, and may also be applied to other scenarios requiring disk space management.
It may be understood that the above method for managing a disk space may be implemented by the apparatus for managing a disk space provided in the embodiments of the present disclosure, where the apparatus for managing a disk space may be part or all of a device, for example, a terminal device or a processor of a terminal device.
The technical solutions of the embodiments of the present disclosure are described in detail below with specific embodiments. The following embodiments may be combined with each other, and some embodiments may not be repeated for the same or similar concepts or processes.
Referring to fig. 2, fig. 2 is a flowchart of a method for managing disk space according to an embodiment of the present disclosure. The execution body of the embodiment is a terminal device, and the embodiment relates to a process of deleting a file in a disk space. The management method of the disk space comprises the following steps:
S201: and receiving a management protocol of the disk space sent by the server, wherein the management protocol of the disk space is used for managing files in the disk space.
In the present disclosure, when a terminal device needs to manage a disk space, a management protocol of the disk space may be requested to a server, and then, the latest management protocol of the disk space is transmitted to the terminal device by the server to manage files in the disk space.
It should be noted that, in the embodiment of the present disclosure, the management protocol of the disk space may be updated in real time by an administrator, so as to adjust the management rule of the file in the disk space in time.
It should be understood that embodiments of the present disclosure are not limited to the content of the management protocol of the disk space, and in some embodiments, the management protocol of the disk space may include information of the protocol total switch, the protocol version, and various management rules of the disk space.
S202: and analyzing the management protocol of the disk space, and determining the information of the management rule of the disk space.
In this step, after the terminal device receives the management protocol of the disk space, the information of the management rule of the disk space may be parsed from the management protocol of the disk space.
It should be understood that the embodiments of the present disclosure are not limited to how to parse the management protocol of the disk space, and any protocol parsing manner may be adopted or indicated by the management protocol of the disk space.
In some embodiments, the information of the management rules of the disk space includes: the scan path of the disk space, the directory of the files stored in the disk space, the classification of the files stored in the disk space, and the deletion level of the files stored in the disk space.
It should be understood that the directory of the file stored in the disk space is used to indicate the managed file in the disk space, and the scan path of the disk space is used to determine the storage locations respectively corresponding to the managed file. The deletion level of the file stored in the disk space is used to determine the deletion mode of the stored file.
The classification of files stored in disk space may include program core files, cache files, and user files, among others. The program core file is a file which can cause the application program to fail to operate normally after the program core file is really, and in practical application, deletion of the program core file should be avoided. The cache file is a file generated when the application program runs, for example, a log file, an advertisement cache, an application program setting parameter, and the like. The user file is a file generated by a user when using the application program, and may be an intermediate file or a final file, for example, a photograph, an editing draft, a video clip material, or the like.
The deletion levels of the files stored in the disk space include a first deletion level, a second deletion level, a third deletion level, and a fourth deletion level. The files of the first deletion level are files which are forbidden to be deleted, the files of the second deletion level are files which are authorized to be deleted by the service of the application program, the files of the third deletion level are files which are authorized to be deleted by the user, and the files of the fourth deletion level are files which are automatically deleted.
In other embodiments, the information of the management rule of the disk space may further include an identifier of the manager setting the management rule of the disk space.
It should be noted that, the information of the management rule of the disk space may be represented by different fields in the management protocol of the disk space.
S203: and scanning the disk space and determining files stored in the disk space.
In this step, after the terminal device parses out the information of the management rule of the disk space, the disk space may be scanned through a scanning path in the information of the management rule of the disk space, to determine the file stored in the disk space.
In some embodiments, after determining the files stored in the disk space, the terminal device may further perform statistics on the files stored in the disk space according to an association relationship between the files stored in the disk space.
The association relationship is a relationship between files stored in different positions when the same service is executed.
For example, if a record exists in the database in addition to the generated file, the association relationship exists between the generated file of the user draft and the generated record in the database, and statistics can be performed together.
For example, if the "filter" file is composed of three files together, there is an association relationship between the three files that compose the "filter" file, and statistics can be performed together.
It should be appreciated that counting files stored in disk space may include counting the size and number of files.
S204: and deleting the target file in the files stored in the disk space according to the information of the management rule of the disk space.
In this step, after the terminal device determines the file stored in the disk space, the target file in the file stored in the disk space may be deleted according to the information of the management rule of the disk space.
It should be understood that, in the embodiments of the present disclosure, there is no limitation on how to delete a target file in a file stored in a disk space according to information of a management rule of the disk space, in some embodiments, a terminal device may first determine a type of the file stored in the disk space, and if the file stored in the disk space is a user file, parse the user file, and determine information of the user file. Then, the user files are displayed on a disk space management interface of the application program, and a deleting instruction input by the user is received, wherein the deleting instruction is used for indicating the target files selected in the user files. And finally, deleting the target file by the terminal equipment. If the file stored in the disk space is a cache file, the terminal device can determine the target file in the cache file according to the service time of the cache file, so as to delete the target file.
The information of the user file may include a resource name, a size, a last use time, a thumbnail, and the like of the user file.
Fig. 3 is a schematic diagram of a first interface of an application according to an embodiment of the disclosure. Fig. 4 is a schematic diagram of a second interface of an application provided by an embodiment of the present disclosure, and fig. 5 is a schematic diagram of a third interface of an application provided by an embodiment of the present disclosure. As shown in fig. 3, the first interface shown in fig. 3, on which the disk space management control is displayed, may be opened by a setup button of the application, and the application may jump to the second interface shown in fig. 4 by clicking on the disk space management control. The second interface displays the use condition of the disk space, and according to the type of the file, a management control of the user file and a management control of the cache file are respectively arranged. By clicking the management control of the user file and the third interface shown in fig. 5, the third interface displays the resource name, the size and the last use time of the user file, and the user can use the selected user file as the target file to input a deletion instruction to the terminal device, so that the target file is deleted.
It should be noted that, the cache file may be automatically deleted by an application program in the terminal device, and for example, if the latest use time of the cache file is 7 months ago, that is, the unused time of the cache file is longer than 6 months, it may be determined that the cache file is unused for a long time, and may be automatically deleted.
In other embodiments, the terminal device may delete the target file in the files stored in the disk space according to the deletion level of the files stored in the disk space.
Illustratively, if the stored file is at the first deletion level, deletion of the file is prohibited in any case. If the stored file is the second deletion level, an external page can be provided, and deletion can be performed after service authorization of an external application program. If the stored file is the third deletion level, the user needs to click or confirm the authorization to delete the file, for example, the file draft generated by the user. If the stored file is the fourth deletion level, deletion can be directly performed without confirmation, and the running of the application program is not affected.
In some embodiments, when deleting the target file, the terminal device may further determine a file having an association relationship with the target file, so as to delete the file having the association relationship with the target file.
A description will be given below of a management protocol for how the server generates a disk space.
In the embodiment of the disclosure, different management rules can be allowed to be implemented by the application program through different interfaces, and then the different management rules are registered in the server, so that a management protocol of the disk space is generated. Exemplary, fig. 6 is a schematic diagram of management rule registration provided in an embodiment of the present disclosure, where, as shown in fig. 6, scanning rules, parsing rules, and deleting rules in a management protocol of a disk space may be customized, and registration is performed through a delegated registry. Wherein, the scanning rule allows more files to be included, and statistics is carried out to form an item; the parsing rules allow the application program to specify information such as details, icons and the like of the items for display; the deletion rule sequence executes additional rules, such as deleting files of specific associations, at the time of deletion.
The embodiment of the disclosure provides a management method for a disk space, which includes the steps of firstly, receiving a management protocol for the disk space sent by a server, wherein the management protocol for the disk space is used for managing files in the disk space; secondly, analyzing a management protocol of the disk space, and determining information of management rules of the disk space; thirdly, scanning the disk space and determining files stored in the disk space; and finally, deleting the target file in the files stored in the disk space according to the information of the management rule of the disk space. In this way, the management rules of the disk space can be updated in real time by the management protocol of the disk space, thereby managing all files in the disk space.
On the basis of the above-described embodiments, the following exemplifies how to delete a target file from among files stored in a disk space based on the type of the stored file. Fig. 7 is a flowchart illustrating another method for managing disk space according to an embodiment of the present disclosure. As shown in fig. 7, the method for managing disk space includes:
s301: and receiving a management protocol of the disk space sent by the server, wherein the management protocol of the disk space is used for managing files in the disk space.
S302: and analyzing the management protocol of the disk space, and determining the information of the management rule of the disk space.
The information of the management rule of the disk space comprises: the scan path of the disk space, the directory of the files stored in the disk space, the classification of the files stored in the disk space, and the deletion level of the files stored in the disk space.
S303: and scanning the disk space according to the scanning path of the disk space, and determining files stored in the disk space.
S304: it is determined whether the file stored in the disk space is a user file.
If yes, step S305 is executed, and if no, step S308 is executed.
S305: and analyzing the user file and determining the information of the user file.
S306: and receiving a deleting instruction input by a user, wherein the deleting instruction is used for indicating a target file selected from user files.
S307: and deleting the target file.
S308: it is determined whether the file stored in the disk space is a cached file.
If yes, step S309 is executed, and if no, step S3010 is executed.
S309: determining a target file in the cache file according to the use time of the cache file;
after step S309, step S307 is performed.
S310: deletion of files stored in disk space is prohibited.
The technical terms, effects, features, and alternative embodiments of S301-S310 may be understood with reference to S201-S204 shown in fig. 2, and will not be further described herein for repeated content.
The following exemplifies a manner of deleting a target file among files stored in a disk space based on the deletion level of the stored file. Fig. 8 is a flowchart illustrating a method for managing disk space according to another embodiment of the present disclosure. As shown in fig. 8, the method for managing disk space includes:
s401: and receiving a management protocol of the disk space sent by the server, wherein the management protocol of the disk space is used for managing files in the disk space.
S402: and analyzing the management protocol of the disk space, and determining the information of the management rule of the disk space.
The information of the management rule of the disk space comprises: the scan path of the disk space, the directory of the files stored in the disk space, the classification of the files stored in the disk space, and the deletion level of the files stored in the disk space.
S403: and scanning the disk space according to the scanning path of the disk space, and determining files stored in the disk space.
S404: and deleting the target file in the files stored in the disk space according to the deletion level of the files stored in the disk space.
In some embodiments, the deletion levels of files stored in the disk space include a first deletion level, a second deletion level, a third deletion level, and a fourth deletion level;
the files of the first deletion level are files which are forbidden to be deleted, the files of the second deletion level are files which are authorized to be deleted by the service of the application program, the files of the third deletion level are files which are authorized to be deleted by the user, and the files of the fourth deletion level are files which are automatically deleted.
The technical terms, effects, features, and alternative embodiments of S401-S404 may be understood with reference to S201-S204 shown in fig. 2, and will not be further described herein for repeated matters.
The embodiment of the disclosure provides a management method for a disk space, which includes the steps of firstly, receiving a management protocol for the disk space sent by a server, wherein the management protocol for the disk space is used for managing files in the disk space; secondly, analyzing a management protocol of the disk space, and determining information of management rules of the disk space; thirdly, scanning the disk space and determining files stored in the disk space; and finally, deleting the target file in the files stored in the disk space according to the information of the management rule of the disk space. In this way, the management rules of the disk space can be updated in real time by the management protocol of the disk space, thereby managing all files in the disk space.
Fig. 9 is a block diagram of a disk space management apparatus according to an embodiment of the present disclosure, corresponding to a stack processing method of the above embodiment. For ease of illustration, only portions relevant to embodiments of the present disclosure are shown. Referring to fig. 9, the disk space management apparatus 500 includes: a receiving module 501, a parsing module 502, a scanning module 503 and a deleting module 504.
The receiving module 501 is configured to receive a management protocol of a disk space sent by a server, where the management protocol of the disk space is used to manage files in the disk space;
The analysis module 502 is configured to analyze a management protocol of the disk space, and determine information of a management rule of the disk space;
a scanning module 503, configured to scan the disk space and determine a file stored in the disk space;
and the deleting module 504 is configured to delete the target file in the files stored in the disk space according to the information of the management rule of the disk space.
In one embodiment of the present disclosure, the information of the management rule of the disk space includes: the scan path of the disk space, the directory of the files stored in the disk space, the classification of the files stored in the disk space, and the deletion level of the files stored in the disk space.
In one embodiment of the present disclosure, the scanning module 503 is specifically configured to scan the disk space according to a scan path of the disk space, and determine a file stored in the disk space.
In one embodiment of the present disclosure, the scanning module 503 is further configured to perform statistics on files stored in the disk space according to an association relationship between files stored in the disk space.
The association relationship is a relationship between files stored in different positions when the same service is executed.
In one embodiment of the present disclosure, the classification of files stored in disk space includes a cache file and a user file, the cache file being a file generated when an application program is running, the user file being a file generated by a user when the application program is in use.
In one embodiment of the present disclosure, the deletion module 504 is specifically configured to parse a user file if the file stored in the disk space is the user file, and determine information of the user file;
displaying user files on a disk space management interface of an application program; receiving a deleting instruction input by a user, wherein the deleting instruction is used for indicating a target file selected from user files; and deleting the target file.
In one embodiment of the present disclosure, the deletion module 504 is specifically configured to determine, if a file stored in the disk space is a cache file, a target file in the cache file according to a usage time of the cache file; and deleting the target file.
In one embodiment of the present disclosure, the deletion levels of files stored in the disk space include a first deletion level, a second deletion level, a third deletion level, and a fourth deletion level;
the files of the first deletion level are files which are forbidden to be deleted, the files of the second deletion level are files which are authorized to be deleted by the service of the application program, the files of the third deletion level are files which are authorized to be deleted by the user, and the files of the fourth deletion level are files which are automatically deleted.
In one embodiment of the present disclosure, the deletion module 504 is specifically configured to delete a target file in a file stored in a disk space according to a deletion level of the file stored in the disk space.
In one embodiment of the present disclosure, the deletion module 504 is specifically configured to determine a file having an association relationship with the target file; and deleting the target file and the file with the association relation with the target file.
The management device for disk space provided in this embodiment may be used to execute the technical solution of the foregoing method embodiment, and its implementation principle and technical effects are similar, and this embodiment is not repeated here.
Fig. 10 is a schematic structural view of an electronic device according to an example embodiment of the present disclosure. As shown in fig. 10, a schematic diagram of an electronic device 600 suitable for use in implementing embodiments of the present disclosure is shown. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal having an image acquisition function such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle-mounted terminal (e.g., a vehicle-mounted navigation terminal), a wearable electronic device, etc., and a fixed terminal having an image acquisition device externally connected thereto such as a digital TV, a desktop computer, a smart home device, etc. The electronic device shown in fig. 10 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 10, the electronic device 600 may include a processor (e.g., a central processing unit, a graphics processor, etc.) 601, which may perform various appropriate actions and processes according to programs stored in a Read Only Memory (ROM) 602 or programs loaded from a memory 608 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data required for the operation of the electronic apparatus 600 are also stored. The processor 601, the ROM 602, and the RAM603 are connected to each other through a bus 604. An input/output (I/O) interface 605 is also connected to bus 604. The memory is used for storing a program for executing the method of each method embodiment; the processor is configured to execute programs stored in the memory to implement the functions of the embodiments of the present disclosure described above and/or other desired functions.
In general, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, and the like; an output device 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, magnetic tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 10 shows an electronic device 600 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a non-transitory computer readable medium, the computer program comprising program code for performing the methods shown in the flowcharts of the embodiments of the present disclosure. In such an embodiment, the computer program may be downloaded and installed from a network via communication means 609, or from storage means 608, or from ROM 502. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processor 601.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: displaying at least one preset mask icon on an input panel of a conversation page; and responding to the triggering operation of the preset mask icon, and switching and displaying the preset mask icon on the input panel as a first expression in a first expression set.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including, but not limited to, an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
In some implementations, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol ), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present disclosure may be implemented in software or hardware. Wherein the name of the module does not constitute a limitation of the unit itself in some cases.
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
In the context of this disclosure, a computer-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a computer-readable storage medium may include one or more wire-based electrical connections, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
In a first aspect, according to one or more embodiments of the present disclosure, there is provided a method for managing disk space, including:
receiving a management protocol of the disk space sent by a server, wherein the management protocol of the disk space is used for managing files in the disk space;
analyzing the management protocol of the disk space and determining the information of the management rule of the disk space;
scanning the disk space and determining files stored in the disk space;
and deleting the target file in the files stored in the disk space according to the information of the management rule of the disk space.
According to one or more embodiments of the present disclosure, the information of the management rule of the disk space includes: the method comprises the steps of scanning a path of the disk space, a directory of files stored in the disk space, classification of the files stored in the disk space and deletion level of the files stored in the disk space.
According to one or more embodiments of the present disclosure, the scanning the disk space, determining a file stored in the disk space, includes:
and scanning the disk space according to the scanning path of the disk space, and determining files stored in the disk space.
According to one or more embodiments of the present disclosure, after the scanning the disk space and determining the file stored in the disk space, the method further includes:
counting the files stored in the disk space according to the association relation between the files stored in the disk space;
the association relationship is a relationship between files stored in different positions when the same service is executed.
According to one or more embodiments of the present disclosure, the classification of files stored in the disk space includes a cache file and a user file, the cache file is a file generated when an application program runs, and the user file is a file generated by the user when the application program is used.
According to one or more embodiments of the present disclosure, the deleting, according to information of a management rule of the disk space, a target file in a file stored in the disk space includes:
if the file stored in the disk space is a user file, analyzing the user file and determining the information of the user file;
displaying the user file on a disk space management interface of the application program;
receiving a deleting instruction input by a user, wherein the deleting instruction is used for indicating the target file selected in the user files;
And deleting the target file.
According to one or more embodiments of the present disclosure, the deleting the target file in the file stored in the disk space according to the information of the management rule of the disk space further includes:
if the file stored in the disk space is a cache file, determining a target file in the cache file according to the service time of the cache file;
and deleting the target file.
According to one or more embodiments of the present disclosure, the deletion levels of the files stored in the disk space include a first deletion level, a second deletion level, a third deletion level, and a fourth deletion level;
the files of the first deletion level are files which are forbidden to be deleted, the files of the second deletion level are files which are authorized to be deleted by the service of the application program, the files of the third deletion level are files which are authorized to be deleted by the user, and the files of the fourth deletion level are files which are automatically deleted.
According to one or more embodiments of the present disclosure, the deleting, according to information of a management rule of the disk space, a target file in a file stored in the disk space includes:
And deleting the target file in the files stored in the disk space according to the deletion grade of the files stored in the disk space.
According to one or more embodiments of the present disclosure, the deleting the target file from the files stored in the disk space includes:
determining a file with an association relationship with the target file;
and deleting the target file and the file with the association relation with the target file.
In a second aspect, according to one or more embodiments of the present disclosure, there is provided a management apparatus for disk space, including:
the receiving module is used for receiving a management protocol of the disk space sent by the server, wherein the management protocol of the disk space is used for managing files in the disk space;
the analysis module is used for analyzing the management protocol of the disk space and determining the information of the management rule of the disk space;
the scanning module is used for scanning the disk space and determining files stored in the disk space;
and the deleting module is used for deleting the target file in the files stored in the disk space according to the information of the management rule of the disk space.
According to one or more embodiments of the present disclosure, the information of the management rule of the disk space includes: the method comprises the steps of scanning a path of the disk space, a directory of files stored in the disk space, classification of the files stored in the disk space and deletion level of the files stored in the disk space.
According to one or more embodiments of the present disclosure, the scanning module is specifically configured to scan the disk space according to a scanning path of the disk space, and determine a file stored in the disk space.
According to one or more embodiments of the present disclosure, the scanning module is further configured to perform statistics on files stored in the disk space according to an association relationship between files stored in the disk space;
the association relationship is a relationship between files stored in different positions when the same service is executed.
According to one or more embodiments of the present disclosure, the classification of files stored in the disk space includes a cache file and a user file, the cache file is a file generated when an application program runs, and the user file is a file generated by the user when the application program is used.
According to one or more embodiments of the present disclosure, a deletion module is specifically configured to parse a user file if a file stored in the disk space is the user file, and determine information of the user file;
displaying the user file on a disk space management interface of the application program; receiving a deleting instruction input by a user, wherein the deleting instruction is used for indicating the target file selected in the user files; and deleting the target file.
According to one or more embodiments of the present disclosure, a deletion module is specifically configured to determine, if a file stored in the disk space is a cache file, a target file in the cache file according to a usage time of the cache file; and deleting the target file.
According to one or more embodiments of the present disclosure, the deletion levels of the files stored in the disk space include a first deletion level, a second deletion level, a third deletion level, and a fourth deletion level;
the files of the first deletion level are files which are forbidden to be deleted, the files of the second deletion level are files which are authorized to be deleted by the service of the application program, the files of the third deletion level are files which are authorized to be deleted by the user, and the files of the fourth deletion level are files which are automatically deleted.
According to one or more embodiments of the present disclosure, the deletion module is specifically configured to delete a target file in a file stored in the disk space according to a deletion level of the file stored in the disk space.
According to one or more embodiments of the present disclosure, a deletion module is specifically configured to determine a file having an association relationship with the target file; and deleting the target file and the file with the association relation with the target file.
In a third aspect, an embodiment of the present disclosure provides an electronic device, including:
a processor; and
a memory for storing a computer program;
wherein the processor is configured to implement the method of managing disk space as described in the first aspect and the various possible designs of the first aspect above by executing the computer program.
In a fourth aspect, embodiments of the present disclosure provide a computer-readable storage medium having stored therein computer-executable instructions that, when executed by a processor, implement a method of managing disk space as described in the first aspect and in the various possible designs of the first aspect.
In a fifth aspect, embodiments of the present disclosure provide a computer program product comprising a computer program which, when executed by a processor, implements the method of managing disk space as described in the first aspect and in the various possible designs of the first aspect.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).
Moreover, although operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are example forms of implementing the claims.

Claims (14)

1. A method for managing disk space, comprising:
receiving a management protocol of the disk space sent by a server, wherein the management protocol of the disk space is used for managing files in the disk space;
Analyzing the management protocol of the disk space and determining the information of the management rule of the disk space;
scanning the disk space and determining files stored in the disk space;
and deleting the target file in the files stored in the disk space according to the information of the management rule of the disk space.
2. The method of claim 1, wherein the information of the management rule of the disk space comprises: the method comprises the steps of scanning a path of the disk space, a directory of files stored in the disk space, classification of the files stored in the disk space and deletion level of the files stored in the disk space.
3. The method of claim 2, wherein the scanning the disk space to determine files stored in the disk space comprises:
and scanning the disk space according to the scanning path of the disk space, and determining files stored in the disk space.
4. A method according to claim 3, wherein after said scanning said disk space and determining files stored in said disk space, said method further comprises:
counting the files stored in the disk space according to the association relation between the files stored in the disk space;
The association relationship is a relationship between files stored in different positions when the same service is executed.
5. The method of claim 2, wherein the classification of files stored in the disk space includes a cached file and a user file, the cached file being a file generated when an application is running, the user file being a file generated by the user when the application is in use.
6. The method of claim 5, wherein deleting the target file from the files stored in the disk space according to the information of the management rule of the disk space comprises:
if the file stored in the disk space is a user file, analyzing the user file and determining the information of the user file;
displaying the user file on a disk space management interface of the application program;
receiving a deleting instruction input by a user, wherein the deleting instruction is used for indicating the target file selected in the user files;
and deleting the target file.
7. The method of claim 5, wherein deleting the target file from the files stored in the disk space according to the information of the management rule of the disk space, further comprises:
If the file stored in the disk space is a cache file, determining a target file in the cache file according to the service time of the cache file;
and deleting the target file.
8. The method of claim 2, wherein the deletion levels of files stored in the disk space include a first deletion level, a second deletion level, a third deletion level, and a fourth deletion level;
the files of the first deletion level are files which are forbidden to be deleted, the files of the second deletion level are files which are authorized to be deleted by the service of the application program, the files of the third deletion level are files which are authorized to be deleted by the user, and the files of the fourth deletion level are files which are automatically deleted.
9. The method of claim 8, wherein deleting the target file from the files stored in the disk space according to the information of the management rule of the disk space comprises:
and deleting the target file in the files stored in the disk space according to the deletion grade of the files stored in the disk space.
10. The method of claim 4, wherein deleting the target file from the files stored in the disk space comprises:
Determining a file with an association relationship with the target file;
and deleting the target file and the file with the association relation with the target file.
11. A disk space management apparatus comprising:
the receiving module is used for receiving a management protocol of the disk space sent by the server, wherein the management protocol of the disk space is used for managing files in the disk space;
the analysis module is used for analyzing the management protocol of the disk space and determining the information of the management rule of the disk space;
the scanning module is used for scanning the disk space and determining files stored in the disk space;
and the deleting module is used for deleting the target file in the files stored in the disk space according to the information of the management rule of the disk space.
12. An electronic device, comprising:
a processor; and
a memory for storing a computer program;
wherein the processor is configured to implement the method of managing disk space of any one of claims 1 to 10 by executing the computer program.
13. A computer program product comprising a computer program which, when executed by a processor, implements a method of managing disk space as claimed in any one of claims 1 to 11.
14. A computer-readable storage medium having stored therein computer-executable instructions which, when executed by a processor, implement the method of managing disk space according to any one of claims 1 to 10.
CN202210803136.0A 2022-07-07 2022-07-07 Disk space management method, device, equipment and storage medium Pending CN117407364A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210803136.0A CN117407364A (en) 2022-07-07 2022-07-07 Disk space management method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210803136.0A CN117407364A (en) 2022-07-07 2022-07-07 Disk space management method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117407364A true CN117407364A (en) 2024-01-16

Family

ID=89487601

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210803136.0A Pending CN117407364A (en) 2022-07-07 2022-07-07 Disk space management method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117407364A (en)

Similar Documents

Publication Publication Date Title
CN111309415B (en) User Interface (UI) information processing method and device of application program and electronic equipment
CN111338797A (en) Task processing method and device, electronic equipment and computer readable storage medium
CN111400625B (en) Page processing method and device, electronic equipment and computer readable storage medium
CN112269959B (en) Control method and device for display content, readable medium and electronic equipment
CN111274503B (en) Data processing method, device, electronic equipment and computer readable medium
CN114491349B (en) Page display method, page display device, electronic device, storage medium and program product
CN111857720B (en) User interface state information generation method and device, electronic equipment and medium
CN115209207B (en) Task processing method, device, equipment and storage medium
CN111694629A (en) Information display method and device and electronic equipment
CN112256372B (en) Information processing method and device and electronic equipment
CN113391860B (en) Service request processing method and device, electronic equipment and computer storage medium
CN112131181A (en) Storage path display method and device and electronic equipment
CN117407364A (en) Disk space management method, device, equipment and storage medium
CN111552705B (en) Data processing method and device based on chart, electronic equipment and medium
CN111382381B (en) User data sharing method and device, mobile terminal and storage medium
CN113535282B (en) Special effect data processing method and device
CN113806189B (en) User interface operation monitoring method, device, equipment and storage medium
CN111641692B (en) Session data processing method and device and electronic equipment
US20230156050A1 (en) Data processing method, apparatus, electronic device and storage medium
CN117336267A (en) Information reply method, device, electronic equipment and storage medium
CN117130752A (en) Data processing method and device and electronic equipment
CN116244166A (en) Application scene access method and device
CN118131953A (en) Data configuration method, device, medium, electronic equipment and program product
CN117493217A (en) Test case generation method and device, readable medium and electronic equipment
CN114594951A (en) Page generation method, page operation method, page generation device, page readable medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination