Disk file management method and device, equipment, medium and product
By automatically deleting files when their reference count reaches a preset value, the lack of precision in disk file management is solved, resulting in more efficient disk space utilization and application stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING BAIDU NETCOM SCI & TECH CO LTD
- Filing Date
- 2025-12-15
- Publication Date
- 2026-05-05
AI Technical Summary
In existing technologies, disk file management lacks precision, which may lead to files being accidentally deleted or occupying disk resources for a long time, affecting storage efficiency and application stability.
By automatically deleting files when their reference count reaches a preset value, and by using a counter and metadata storage layer to manage file reference counts, timely file cleanup is ensured.
It improves the accuracy and efficiency of disk file management, reduces the risk of accidental file deletion, and enhances application stability and disk space utilization.
Smart Images

Figure CN121979845A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of artificial intelligence technology, and in particular to the fields of data storage and application development, specifically to a disk file management method, apparatus, device, medium, and product. Background Technology
[0002] Mobile disk storage refers to storing data as files on the mobile device's hard drive. Disk file management involves creating, using, and deleting files stored on the hard drive to achieve efficient, secure, and accurate data storage and access. Summary of the Invention
[0003] This disclosure provides a disk file management method, apparatus, device, medium, and product.
[0004] According to one aspect of this disclosure, a disk file management method is provided, comprising: receiving an update request sent by a business module in an application, the update request being sent by the business module in response to a change in the reference status of a file stored on the disk; updating the reference count of the file based on the update request to obtain an updated reference count; and deleting the file from the disk in response to determining that the updated reference count is a preset value.
[0005] According to another aspect of this disclosure, a disk file management device is provided, comprising: a receiving module for receiving an update request sent by a business module in an application, the update request being sent by the business module in response to a change in the reference status of a file stored on the disk; an updating module for updating the reference count of the file based on the update request to obtain an updated reference count; and a deletion module for deleting the file on the disk in response to determining that the updated reference count is a preset value.
[0006] According to another aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to said at least one processor; wherein the memory stores instructions executable by said at least one processor, said instructions being executed by said at least one processor to enable said at least one processor to perform the method as described in any of the foregoing aspects.
[0007] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are configured to cause the computer to perform the method according to any of the preceding aspects.
[0008] According to another aspect of this disclosure, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the method according to any of the preceding aspects.
[0009] According to embodiments of this disclosure, the accuracy of disk file management can be improved.
[0010] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0011] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:
[0012] Figure 1 This is a schematic diagram based on the first embodiment of the present disclosure;
[0013] Figure 2 This is a schematic diagram of the overall architecture provided according to embodiments of this disclosure;
[0014] Figure 3 This is a schematic diagram according to the second embodiment of the present disclosure;
[0015] Figure 4 This is a schematic diagram illustrating the updating of reference counts according to embodiments of this disclosure;
[0016] Figure 5 This is a schematic diagram according to the third embodiment of the present disclosure;
[0017] Figure 6 This is a schematic diagram of an electronic device used to implement the disk file management method of the embodiments of this disclosure. Detailed Implementation
[0018] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0019] Figure 1 This is a schematic diagram based on the first embodiment of the present disclosure, which provides a disk file management method. For example... Figure 1 As shown, the method includes:
[0020] 101. Receive an update request sent by a business module in the application, wherein the update request is sent by the business module after the reference status of a target file stored on the disk has changed.
[0021] 102. Based on the update request, update the reference count of the target file to obtain the updated reference count.
[0022] 103. In response to determining that the updated reference count is a preset value, delete the target file on the disk.
[0023] The method in this embodiment can be executed by an application, specifically a mobile application, such as an iOS application or an Android application.
[0024] Applications typically include multiple business modules, each performing different functions. For example, in e-commerce applications, business modules may include product modules, shopping cart modules, and order modules. The product module provides services such as displaying product details data, the shopping cart module provides services such as adding products to the shopping cart, and the order module provides services related to orders.
[0025] When a business module provides a service, it can reference one or more files. Different business modules can reference the same or different files.
[0026] Files can be stored on a disk, which is a non-volatile storage medium. For example, in a mobile scenario, files can be stored on the Secure Digital Memory Card (SD) of the mobile device where the mobile application resides.
[0027] The files can specifically include: images, videos, configuration files, or data files, etc.
[0028] If a file is not used for a long time, that is, it is not referenced by any business module, the file can be called an invalid file. Invalid files will cause disk space to be occupied by unnecessary resources.
[0029] In related technologies, deletion can be done manually. For example, if a user uses business module A, and the business module needs to reference file X, after business module A releases file X (i.e., no longer references file X), the user may think that file X is no longer needed and manually generate a deletion command for file X, which is then used to delete file X. However, this method may lead to accidental deletion. For instance, business module B may need to reference file X. If file X has been deleted, business module B can no longer reference file X and cannot provide related services.
[0030] In related technologies, deletion can also be based on cache time. For example, when file X is stored on disk, the storage time is recorded, and file X is deleted after the preset expiration time is reached. However, this method is not precise. If a short expiration time is set, the file will be deleted after the expiration time, but the file may still be needed later, leading to accidental deletion. If a long expiration time is set, invalid files may occupy disk resources for a long time, resulting in wasted resources.
[0031] In other words, the above methods lack clear signals, which can lead to imprecise management, such as storing unnecessary files for a long time or deleting needed files.
[0032] In this embodiment, a reference count is set for each file, and then the file is managed based on the reference count. If the reference count reaches a preset value, the corresponding file is deleted.
[0033] This allows for disk file management based on explicit signals (reference counts), solving the problem of lacking clear signals in methods such as caching, and improving the accuracy of disk file management.
[0034] The reference count is used to represent the number of business modules that reference this file.
[0035] For example, when a file is created or first referenced, the initial reference count of the file can be set to 1. After that, the reference count can be increased by 1 each time a business module references the file; or, the reference count can be decreased by 1 each time a business module releases (no longer references) the file.
[0036] Once the reference count becomes 0, it indicates that no business module references the file, and at this point, the file can be deleted from the disk.
[0037] Figure 2 This is a schematic diagram of the overall architecture provided according to embodiments of this disclosure.
[0038] Disk file management methods can be performed by the manager, such as... Figure 2 As shown, the manager 200 includes a counter 201 and a metadata storage layer 202.
[0039] Counter 201 is used to set and update the number of times a file is referenced;
[0040] The metadata storage layer 202 is used to store the number of references and their corresponding file identifiers. Furthermore, it can also store reference details, such as which business modules or modules reference the file.
[0041] When a file is created or first referenced, a counter can set an initial reference count for that file, which can be set to 1. Subsequently, the counter updates the reference count for the corresponding file based on update requests sent by the business modules.
[0042] Specifically, the counter can provide two interfaces, which can be called the reference interface and the release interface. When a business module references a file, it sends a reference request to the counter through the reference interface. This reference request contains the file identifier. After receiving the reference request, the counter interacts with the metadata storage layer and increments the reference count corresponding to that file identifier by 1. Conversely, when a business module releases a file, it sends a release request to the counter through the release interface. This release request contains the file identifier. After receiving the release request, the counter interacts with the metadata storage layer and decrements the reference count corresponding to that file identifier by 1.
[0043] The metadata storage layer can specifically be a key-value (KV) database, where the key (K) records the file identifier and the value (V) records the number of references corresponding to the file identifier. Furthermore, it can also record reference details.
[0044] When the counter interacts with the metadata storage layer, it can specifically send read / write instructions to the metadata storage layer to update the reference count.
[0045] The read and write instructions described above are atomic, especially in a multi-threaded environment, to prevent incorrect reference counts.
[0046] Atomicity means that an operation can be completed completely or not at all without being interrupted by any other thread.
[0047] For example, in a scenario involving reference counts, suppose the first thread needs to increment the reference count by 1. This operation specifically includes: reading the current value; incrementing by 1 to get the new value; and writing the new value. During this process, the second thread cannot perform operations between the above read-increment-write operations. In this way, it can be ensured that each thread reads and writes the reference count normally.
[0048] In addition, the metadata storage layer can be located on the disk. Since the disk is a non-volatile storage medium, it can achieve persistent storage of metadata (such as reference counts and their corresponding file identifiers). This enables accurate tracking of file reference counts across processes and sessions (even if the application restarts), further improving the accuracy of disk file management.
[0049] In addition, by storing reference details, it is possible to trace the resource source of a file, making it easier to diagnose why a file is being used.
[0050] Figure 3This is a schematic diagram based on a second embodiment of the present disclosure, which provides a disk file management method. For example... Figure 3 As shown, the method includes:
[0051] 301. A counter receives update requests sent by business modules in the application, the update requests being sent by the business modules in response to changes in the reference status of files stored on the disk.
[0052] 302. A counter interacts with the metadata storage layer to update the reference count of the file based on the update request, so as to obtain the updated reference count.
[0053] 303. A counter, in response to determining that the updated reference count is a preset value, deletes the file on the disk.
[0054] The update request may include a reference request or a release request. The reference request indicates that the reference state is updated from a non-reference state to a reference state, and the release request indicates that the reference state is updated from a reference state to a non-reference state. The counter can increment the corresponding reference count based on the reference request and decrement the corresponding reference count based on the release request.
[0055] For example, refer to Figure 4 , Figure 4 This is a schematic diagram illustrating the update of reference counts according to embodiments of this disclosure.
[0056] like Figure 4 As shown, assume that the disk files include file A and file B. Initially, the reference count of both file A and file B is 1.
[0057] Then, assuming module X references file B, module X sends a reference request to the counter. Specifically, it can send the reference request through the reference interface provided by the counter. The reference request contains the identifier of file B. When the counter receives the reference request, it increments the reference count of file B in the metadata storage layer by 1, that is, the updated reference count of file B = 2.
[0058] Then, assuming module Y releases file A, module Y sends a release request to the counter. Specifically, the release request can be sent through the release interface provided by the counter. The release request contains the identifier of file A. When the counter receives the release request, it decrements the reference count of file A in the metadata storage layer by 1, that is, the updated reference count of file A = 0.
[0059] Since the updated reference count of file A is 0, file A can be deleted from the disk.
[0060] Specifically, the counter can call the operating system's secure deletion interface, which triggers the operating system to delete file A from the disk.
[0061] In addition, the counter can also interact with the metadata storage layer to delete relevant information about file A, such as deleting file A's identifier and reference count.
[0062] In this embodiment, by incrementing the reference count by 1 when the update request is a reference request and decrementing the reference count by 1 when the update request is a release request, the reference count can be updated easily and efficiently, thus improving the accuracy of the reference count.
[0063] In addition, by deleting the corresponding file when the reference count is 0, unnecessary files can be deleted promptly and automatically, improving processing timeliness.
[0064] Furthermore, by determining whether an update request is a reference request or a release request based on different interfaces, the error rate of disk file management can be reduced and the stability of application operation can be improved.
[0065] In addition, this embodiment manages files based on the number of references using a counter. Business modules do not need to pay attention to whether files are deleted, nor do they need to manage files. This allows business modules to focus on business functions and improve their business capabilities, such as recommendation accuracy and response speed, thereby enhancing the user experience.
[0066] In some embodiments, the method may further include:
[0067] In response to the achievement of preset conditions, a first file identifier and a second file identifier are obtained. The first file identifier is a file identifier recorded in the metadata storage layer, and the second file identifier is a file identifier recorded in the disk file list. The disk file list is generated by the operating system of the terminal where the application is located.
[0068] The target file identifier is determined in the second file identifier, wherein the second file identifier contains the target file identifier and the first file identifier does not contain the target file identifier;
[0069] A cleanup flag is added to the target file corresponding to the target file identifier so that the operating system can perform a cleanup operation on the target file.
[0070] The preset conditions include, for example, when the application starts or when a preset period is reached. At this time, the first file identifier and the second file identifier can be obtained. For example, the first file identifier includes A and B, and the second file identifier includes A, B, and C. Then C is the target file identifier, and the counter can mark the file C as a cleanup flag. After the cleanup conditions are met, the operating system cleans up the file C. For example, after the operating system receives a cleanup command or reaches the cleanup period, it deletes the file C from the disk.
[0071] In this embodiment, by comparing the first file identifier and the second file identifier, a cleanup mark is added to the target file, which can trigger the operating system to clean up unnecessary files in a timely manner, avoid waste of disk space, and improve the effectiveness of disk files.
[0072] Figure 5 This is a schematic diagram based on a third embodiment of the present disclosure, which provides a disk file management device. For example... Figure 5 As shown, the device 500 includes: a receiving module 501, an updating module 502, and a deleting module 503.
[0073] The receiving module 501 is used to receive an update request sent by a business module in the application, the update request being sent by the business module after the reference status of a file stored on the disk has changed; the updating module 502 is used to update the reference count of the file based on the update request to obtain the updated reference count; the deleting module 503 is used to delete the file on the disk in response to determining that the updated reference count is a preset value.
[0074] In this embodiment, disk files can be managed based on explicit signals (reference counts), which solves the problem of lack of obvious signals based on cache time and improves the accuracy of disk file management.
[0075] In some embodiments, the update module 502 is further configured to:
[0076] In response to determining that the update request is a reference request, the reference count is incremented by 1; the reference request is used to indicate that the reference state is updated from a non-reference state to a reference state; or,
[0077] In response to determining that the update request is a release request, the reference count is decremented by 1; the release request is used to indicate that the reference state is updated from a reference state to a non-reference state.
[0078] In this embodiment, by incrementing the reference count by 1 when the update request is a reference request and decrementing the reference count by 1 when the update request is a release request, the reference count can be updated simply and efficiently, improving the indirectness and clarity of the reference count.
[0079] In some embodiments, the deletion module 503 is further configured to:
[0080] In response to determining that the updated reference count is 0, the file is deleted from the disk.
[0081] In this embodiment, by deleting the corresponding file when the reference count is 0, unnecessary files can be deleted in a timely and automatic manner, improving processing timeliness.
[0082] In some embodiments, the reference request is sent by the business module by calling the reference interface, and the release request is sent by the business module by calling the release interface. The reference interface and the release interface are two different preset interfaces.
[0083] In this embodiment, the update request is determined to be a reference request or a release request based on different interfaces. This allows for accurate determination of reference requests or release requests based on interfaces, thereby reducing the error rate of disk file management and improving the stability of application operation.
[0084] In some embodiments, the reference count and file identifier are stored in a metadata storage layer, and the metadata storage layer is located on the disk.
[0085] In this embodiment, by storing the reference count on the disk, the reference count of a file can be accurately tracked across processes and sessions (even if the application restarts), further improving the accuracy of disk file management.
[0086] In some embodiments, the device 500 further includes:
[0087] The self-test module is used to, in response to reaching a preset condition, obtain a first file identifier and a second file identifier, wherein the first file identifier is a file identifier recorded in the metadata storage layer, and the second file identifier is a file identifier recorded in the disk file list, wherein the disk file list is generated by the operating system of the terminal where the application is located; determine a target file identifier in the second file identifier, wherein the second file identifier contains the target file identifier and the first file identifier does not contain the target file identifier; and add a cleanup flag to the target file corresponding to the target file identifier so that the operating system performs a cleanup operation on the target file.
[0088] In this embodiment, by comparing the first file identifier and the second file identifier, a cleanup mark is added to the target file, which can trigger the operating system to clean up unnecessary files in a timely manner, avoid waste of disk space, and improve the effectiveness of disk files.
[0089] It is understood that the same or similar content in different embodiments of this disclosure can be referred to each other.
[0090] It is understood that the terms "first" and "second" in the embodiments of this disclosure are only used for distinction and do not indicate the degree of importance or the order of events.
[0091] It is understandable that, unless otherwise specified, the order of steps in the process indicates that the temporal relationship between these steps is not limited.
[0092] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0093] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0094] Figure 6 A schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present disclosure is shown. The electronic device 600 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0095] like Figure 6 As shown, the electronic device 600 includes a computing unit 601, which can perform various appropriate actions and processes based on a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. The RAM 603 may also store various programs and data required for the operation of the electronic device 600. The computing unit 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0096] Multiple components in electronic device 600 are connected to I / O interface 605, including: input unit 606, such as keyboard, mouse, etc.; output unit 607, such as various types of displays, speakers, etc.; storage unit 608, such as disk, optical disk, etc.; and communication unit 609, such as network card, modem, wireless transceiver, etc. Communication unit 609 allows electronic device 600 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0097] The computing unit 601 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above, such as disk file management methods. For example, in some embodiments, the disk file management method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by the computing unit 601, one or more steps of the disk file management method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform disk file management methods by any other suitable means (e.g., by means of firmware).
[0098] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0099] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable task processing device, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0100] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0101] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0102] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0103] Computer systems can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. A server can be a cloud server, also known as a cloud computing server or cloud host, a hosting product within the cloud computing service system that addresses the shortcomings of traditional physical hosts and VPS (Virtual Private Server) services, such as high management difficulty and weak business scalability. Servers can also be servers for distributed systems or servers incorporating blockchain technology.
[0104] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0105] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A disk file management method, comprising: Receive update requests sent by business modules in the application, the update requests being sent by the business modules in response to changes in the reference status of files stored on the disk; Based on the update request, the reference count of the file is updated to obtain the updated reference count; In response to determining that the updated reference count is a preset value, the file is deleted from the disk.
2. The method according to claim 1, wherein, The step of updating the historical reference count of the target file based on the update request includes: In response to determining that the update request is a reference request, the reference count is incremented by 1; the reference request is used to indicate that the reference state is updated from a non-reference state to a reference state; or, In response to determining that the update request is a release request, the reference count is decremented by 1; the release request is used to indicate that the reference state is updated from a reference state to a non-reference state.
3. The method according to claim 2, wherein, The step of deleting the target file on the disk in response to determining that the updated reference count is a preset value includes: In response to determining that the updated reference count is 0, the target file is deleted from the disk.
4. The method according to claim 2, wherein, The reference request is sent by the business module by calling the reference interface, and the release request is sent by the business module by calling the release interface. The reference interface and the release interface are two different preset interfaces.
5. The method according to claim 1, wherein, The reference count and file identifier are stored in the metadata storage layer, which is located on the disk.
6. The method according to any one of claims 1-5, further comprising: In response to the achievement of preset conditions, a first file identifier and a second file identifier are obtained. The first file identifier is a file identifier recorded in the metadata storage layer, and the second file identifier is a file identifier recorded in the disk file list. The disk file list is generated by the operating system of the terminal where the application is located. The target file identifier is determined in the second file identifier, wherein the second file identifier contains the target file identifier and the first file identifier does not contain the target file identifier; A cleanup flag is added to the target file corresponding to the target file identifier so that the operating system can perform a cleanup operation on the target file.
7. A disk file management device, comprising: The receiving module is used to receive update requests sent by business modules in the application. The update requests are sent by the business modules after the reference status of files stored on the disk has changed. An update module is used to update the reference count of the file based on the update request, so as to obtain the updated reference count; A deletion module is used to delete the file on the disk in response to determining that the updated reference count is a preset value.
8. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6.
9. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-6.
10. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-6.