Method, device and equipment for cleaning resources
By maintaining two resource sets during the draft editing process and automatically cleaning up unused resources, the storage space occupation problem caused by draft resource management is solved, improving device performance and user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING ZITIAO NETWORK TECH CO LTD
- Filing Date
- 2024-10-21
- Publication Date
- 2026-04-21
AI Technical Summary
In existing technologies, improper draft resource management leads to excessive storage space usage on devices, affecting device performance, and resource cleanup is not intelligent enough.
By maintaining two sets, one recording all resources and the other recording the resources currently used in the draft, unused resources are automatically cleaned up by comparing the sets, thus reducing the draft size.
Effectively clean up unused draft resources, reduce storage space usage, and improve device performance and user experience.
Smart Images

Figure CN121900928A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and more specifically, to a method, apparatus, computing device, computer-readable storage medium, and computer program product for cleaning up resources. Background Technology
[0002] When creating videos using applications on electronic devices, users often need to use the draft function. The draft function allows users to save their current progress before finishing editing the video, so they can continue editing or refining it later. This is especially convenient for users who need to complete video production in stages or who want to make multiple modifications and optimizations to the video at different times.
[0003] Drafts include a wide variety of creative materials or resources, such as videos, music, stickers, and effects. As users continue to create videos, the resources they use also increase. Excessive resources not only consume device storage space but can also lead to a decline in device performance. Therefore, it is necessary to manage the resources used during video creation, appropriately clearing some resources to keep the application's storage space usage low and ensure device performance. Summary of the Invention
[0004] In view of this, the present disclosure provides a method, apparatus, computing device, computer-readable storage medium, and computer program product for cleaning up resources, which can detect which resources a draft references when it needs to be saved, automatically clean up unused resources, and reduce the size of the entire draft.
[0005] According to a first aspect of this disclosure, a method for cleaning up resources is provided, comprising: when a user is editing a draft, storing information of at least one object of the draft in a first set and storing at least one object in a second set with weak references, wherein each object is linked to a corresponding resource and can be recycled; determining objects of unused resources in the draft by comparing the first set and the second set; and cleaning up resources corresponding to the unused objects.
[0006] According to a second aspect of this disclosure, an apparatus for cleaning up resources is provided, comprising: a set determination unit configured to, when a user is editing a draft, store information of at least one object of the draft in a first set and store at least one object in a second set with weak references, wherein each object is linked to a corresponding resource and can be recycled; a useless resource determination unit configured to determine objects of unused resources in the draft by comparing the first set and the second set; and a resource cleaning unit configured to clean up resources corresponding to unused objects.
[0007] According to a third aspect of this disclosure, a computing device is provided, comprising: at least one processing unit; and at least one memory coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, the instructions, when executed by the at least one processing unit, causing the computing device to perform the method as described in the first aspect of this disclosure.
[0008] According to a fourth aspect of this disclosure, a non-transient computer storage medium is provided, including machine-executable instructions that, when executed by a device, cause the device to perform the method as described in the first aspect of this disclosure.
[0009] According to a fifth aspect of this disclosure, a computer program product is provided, including machine-executable instructions that, when executed by a device, cause the device to perform the method as described in the first aspect of this disclosure.
[0010] It should be understood that the summary 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 above and other objects, features, and advantages of embodiments of the present disclosure will become more readily understood from the following detailed description with reference to the accompanying drawings. In the drawings, several embodiments of the present disclosure will be described by way of example and non-limitation, wherein:
[0012] Figure 1 A schematic diagram of an example environment that can be implemented according to embodiments of the present disclosure is shown;
[0013] Figure 2 A schematic diagram illustrating a creative application according to an embodiment of the present disclosure is shown;
[0014] Figure 3 A flowchart of a method for cleaning up resources according to an embodiment of the present disclosure is shown;
[0015] Figure 4 A schematic diagram of a resource cleanup process according to an embodiment of the present disclosure is shown;
[0016] Figure 5 A schematic diagram showing the changes of a first set and a second set over time according to embodiments of the present disclosure is shown;
[0017] Figure 6 A block diagram of an apparatus for cleaning up resources according to embodiments of the present disclosure is shown; and
[0018] Figure 7A block diagram of an electronic device according to an embodiment of the present disclosure is shown.
[0019] In all the accompanying figures, the same or similar reference numerals denote the same or similar elements. Detailed Implementation
[0020] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0021] In the description of embodiments of this disclosure, the term "comprising" and similar terms should be understood as open-ended inclusion, i.e., "including but not limited to". The term "based on" should be understood as "at least partially based on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc., may refer to different or the same objects unless explicitly stated. Other explicit and implicit definitions may also be included below.
[0022] When creating drafts, users often experiment with many different creative materials, but only retain a few applied to videos / images when saving the draft. Draft editing pages typically have a function to discard the current edit; for example, a draft might have a custom sticker, which the user no longer wants to use. If the custom sticker resource is deleted simply because the draft no longer uses it, the user can choose to discard the edit when exiting, and the draft will revert to the version it was in when the editing page was first opened. At this point, the draft still references the custom sticker resource. Then, the next time the user opens the draft, the sticker effect is lost because the resource has been deleted. Therefore, current creative applications typically follow a "only add, never delete" principle when handling draft resources. However, this principle leads to drafts occupying a large amount of disk cache space, impacting the user experience.
[0023] To address or mitigate the aforementioned problems and / or other potential issues, embodiments of this disclosure propose a method for resource cleanup. According to this method, throughout the creation process, two sets are maintained: one set records all created resources, and the other set stores resources currently in use by the draft model. By comparing these two sets, unused resources can be identified. This allows the system to detect which resources a draft references when it needs to be saved, automatically cleaning up unused resources, reducing the overall draft size, and saving resource storage space.
[0024] The basic principles and implementation of this disclosure are illustrated below with reference to the accompanying drawings. It should be understood that the exemplary embodiments given are merely intended to enable those skilled in the art to better understand and implement the embodiments of this disclosure, and are not intended to limit the scope of this disclosure in any way.
[0025] Figure 1 A schematic diagram of an environment 100 in which various embodiments of the present disclosure can be implemented is shown. For example... Figure 1 As shown, environment 100 includes user 101 and user terminal 102. Optionally, user terminal 102 can be a smartphone, tablet, laptop, smart TV, in-vehicle computer, wearable device (e.g., smart bracelet, smartwatch), etc., with a display function. A creative application 105 can be installed on user terminal 102. User 101 can use the creative application 105 to edit audio and video, such as by adding music and image effects. In some implementations, in addition to running the creative application 105, user terminal 102 can also implement functions related to the creative application 105 through mini-programs or web pages, allowing user 101 to create content on different platforms.
[0026] like Figure 1 As shown, the video creation application 105 of the user terminal 102 may include a draft 103 and a resource library 104. The user 101 can upload resources to be edited (e.g., videos / images) to the resource library 104 based on the video creation application 105, and edit the videos / images using the draft 103 by calling the material resources (e.g., stickers, effects, etc.) stored in the resource library 104. In some embodiments, the resource library 104 may also be deployed on a network server, and the user 101 can download and call the material resources of the resource library 104 on the network server. This disclosure does not limit the deployment location of the resource library 104. As mentioned above, if all resources used in the draft 103 are added without deletion, the creation application will occupy a large amount of disk storage space and may even affect device performance. The following will combine... Figure 2 Describe the structure of the creative application in detail.
[0027] Figure 2 A schematic diagram of a creation application 200 according to an embodiment of the present disclosure is shown. Figure 2 The applications shown can be Figure 1 An exemplary implementation of the creative application 105.
[0028] In some embodiments, the authoring application 105 may include a draft description 202, a private resource 203, and a public resource 204. The draft description 202 may indicate the data model used by the draft 103 (e.g., a music model, a sticker model, etc.). The draft description 202 includes a unique identifier (id) representing the draft and information about the resources used by the draft, which may be private or public resources. The draft description 202 may record address information indicating the actual storage location of the resources, such as a local directory or network address. In this document, private resources refer to resources unique to the draft, and public resources refer to resources shared by multiple drafts.
[0029] When a user edits a draft, each resource in the draft is assigned a corresponding object. The object includes the resource's attributes (e.g., address information) and associated methods to manage and manipulate the resource. According to the garbage collection mechanism, if no references to a given object exist in memory (except for weak references), that object will be reclaimed.
[0030] In some embodiments, private resources 203 may include video 203-1, image 203-2, and audio 203-3, etc. In some implementations, private resources 203 may be stored in a local database 104, and if lost or deleted, the draft 103 containing the lost private resources 203 will be unrecoverable.
[0031] In some embodiments, public resources 204 can be stored in a local database 104 or a resource database 104 deployed on a network server. If the local public resource 204 is lost or deleted, user 101 can access the resource database 104 via the network to download the lost public resource 204 during the draft 103 recovery process. Public resources 204 may include effects resources 204-1, templates 204-2, and music 204-3, etc. During draft editing, redundant private resources 203 and public resources 204 stored in user terminal 102 can lead to large disk cache usage, requiring the identification and cleanup of useless resources.
[0032] The following is for reference Figure 3 Further describe the process of cleaning up resources. Figure 3 A flowchart illustrating a method 300 for cleaning up resources according to some embodiments of the present disclosure is shown. In some embodiments, method 300 may be, for example... Figure 1 This is implemented using the user terminal 102 shown. It should be understood that method 300 may also include additional actions not shown and / or the actions shown may be omitted, and the scope of this disclosure is not limited in this respect.
[0033] like Figure 3As shown in box 310, method 300 may include: while a user is editing a draft, storing information about at least one object of the draft in a first set and storing at least one object as a weak reference in a second set, wherein each object is linked to a corresponding resource and can be recycled. In some embodiments, the resource corresponding to at least one object may be, for example, Figure 2 The private resource 203 is shown. Whenever a user attempts to apply a different resource to a video / image in the draft, information related to that resource is added to the first collection. Optionally, the information related to the resource can be address information. For example, in response to the addition of a resource for at least one object to the draft, the path of that at least one object is recorded in the first collection. That is, the first collection records the address information of resources used during the creation process.
[0034] In some embodiments, the second set may include a weak reference-based data structure. A weak reference is a reference relationship that does not prevent garbage collection. If an object is only referenced by a weak reference, then the object is considered inaccessible (or weakly accessible) and may be garbage collected at any time. Whenever a user adds the resource of at least one object to the draft, that at least one object will be added to the weak reference-based data structure (i.e., the second set).
[0035] When the user terminal triggers the garbage collection mechanism, if at least one object contains a corresponding resource that is not referenced in the draft, then due to weak references, the garbage collection mechanism will ignore the weak references to these objects in the second set and destroy these objects in the second set. The garbage collection mechanism can be based on memory management mechanisms and can be triggered periodically or automatically when certain conditions are met.
[0036] In box 320, method 300 may include: determining unused resource objects in the draft by comparing a first set and a second set. Since some objects in the second set are destroyed without being referenced by the saved draft, the number of resource objects recorded in the second set will be less than the number of resource objects recorded in the first set. In some embodiments, the comparison of the first and second sets can be performed after it is determined that the draft has been saved. In some embodiments, destroyed objects in the second set can be determined first, and then, based on information (e.g., address information) corresponding to the destroyed objects in the first set, resource objects in the difference set between the first and second sets can be determined as unused resource objects in the draft. In other words, an unused resource object in the draft is one whose address information exists in the first set and has been recorded as destroyed in the second set.
[0037] In box 330, method 300 may include: cleaning up resources corresponding to unused objects. After identifying the objects of resources not used in the draft, resource objects with address information in a first set can be extracted, for example, by calling a cleanup function, while the remaining resource objects are released. In some embodiments, after cleaning up resources corresponding to unused objects, the first and second sets may be reset for redundant resource identification during the next draft editing by the user.
[0038] Figure 4 A schematic diagram of a resource cleanup process according to an embodiment of the present disclosure is shown. Figure 4 As shown, in step 401, the user can add an image to the authoring application to edit it using the draft function within the application. As mentioned above, the image can be considered a private resource and stored in the root directory of the draft. In step 402, in response to the image being added to the draft, the user terminal can automatically generate the path of the image (which can be referred to as address 0) and add the path to the first set, and create a weak reference object 0 for the image and add it to the second set.
[0039] In step 403, the user can use the draft function to add material resources to the image, such as a custom sticker 1. In step 404, in response to the custom sticker 1 being applied to the image editing, the user terminal can automatically generate the path of the custom sticker 1 (which can be called address 1) and add the path to the first set, and create a weak reference object 1 of the custom sticker 1 and add it to the second set. At this time, the first set stores the addresses of the image and the custom sticker 1, and the second set stores the weak reference objects of the image and the custom sticker 1.
[0040] In step 405, the user can continue to add material resources to the image, such as custom sticker 2. In step 406, in response to the application of custom sticker 2 to image editing, the user terminal can automatically generate the path of custom sticker 2 (which can be called address 2) and add the path to the first set, and create a weak reference object 2 of custom sticker 2 and add it to the second set. At this time, the first set stores address 0 to address 2, and the second set stores weak reference object 0 to weak reference object 2.
[0041] In step 407, the user can delete unnecessary resource elements, such as custom sticker 2, during the draft editing process. Due to the weak reference to custom sticker 2 in the second set, the deletion of custom sticker 2 will not be affected. However, since custom sticker 2 is only deleted in the draft, it still occupies some space in the disk cache. In step 408, the user terminal triggers garbage collection at some point, checking whether objects in memory have become garbage, such as objects without references. In step 409, since the custom sticker 2 referenced by the weakly referenced object 2 in the second set has been deleted, weakly referenced object 2 is now an object without references and will be destroyed from the second set.
[0042] In step 410, after the user finishes editing the image, they can choose to save the draft. At this point, all resources used by the user and valid resources will be stored in the first set and the second set, respectively. In step 411, the user terminal can calculate the difference set of useless resources based on the addresses of resources stored in the first set and the weak reference objects of resources stored in the second set. For example, based on address 0-address 2 in the first set and weak reference object 0-weak reference object 1 in the second set, the useless resource can be calculated as custom sticker 2. Then, in step 412, the user terminal can call the memory resource release function to clean up the useless resources, thereby reducing the overall size of the draft and improving the user experience.
[0043] Figure 5 A schematic diagram 500 illustrates the changes of a first set and a second set over time according to embodiments of the present disclosure. (See diagram 500.) Figure 5 As shown, let A represent the first set and B represent the second set. At time t0, the system is in its initial state, and the user has not yet added any resources to the draft for content creation. At this time, both the first and second sets are empty. At time t1, the user has tried several resources in the draft and has not deleted any resources before saving the draft. At this time, both the first and second sets contain all resources, so the number of objects in the first and second sets is the same.
[0044] At time t2, the user tried several new resource assets and deleted several unwanted ones from the draft. At this point, the first set contains all resources, while the second set contains only valid resources. Therefore, the number of objects in the first set is greater than the number of objects in the second set. At time t3, the user continued to try several new resource assets and deleted several more unwanted ones from the draft. At this point, the number of objects in both the first and second sets increased, but the first set still contains all resources, while the second set still contains only valid resources. Therefore, the number of objects in the first set is still greater than the number of objects in the second set.
[0045] At time t4, the user chooses to save the edited draft. At this point, the user terminal first identifies useless resources based on the first and second sets, and then invokes the invalid resource removal capability to remove the invalid resources. After removing the invalid resources, the user terminal sets both the first and second sets to empty sets for use in determining redundant resources during the next draft editing session.
[0046] At time t5, the user re-edited the draft, tried several resource sets, and then deleted several unwanted resources from the draft. The first and second sets, which are empty, store all resources and invalid resources, respectively. At time t6, the user chooses to save the edited draft. At this point, the user terminal first identifies useless resources based on the first and second sets, and then invokes the invalid resource removal capability to remove the invalid resources. After removing the invalid resources, the user terminal once again sets the first and second sets to empty for the next invalid resource identification.
[0047] The above is for reference only. Figures 1 to 5 Exemplary embodiments of this disclosure are described. Compared to existing resource cleanup schemes, the resource cleanup scheme of this disclosure, when a draft needs to be saved, senses which resources the draft references and automatically cleans up unused resources, thereby reducing the overall size of the draft.
[0048] Figure 6 A schematic block diagram of an apparatus 600 for cleaning up resources according to an embodiment of the present disclosure is shown. Figure 6 As shown, the apparatus 600 includes: a set determination unit 610, a useless resource determination unit 620, and a resource cleanup unit 630. In some embodiments, the set determination unit 610 is configured to, when a user edits a draft, store information of at least one object of the draft in a first set and store at least one object in a second set with weak references, wherein each object is linked to a corresponding resource and can be recycled. The useless resource determination unit 620 is configured to determine objects of unused resources in the draft by comparing the first set and the second set. The resource cleanup unit 630 is configured to clean up resources corresponding to unused objects.
[0049] It should be noted that the reference Figures 1 to 5 More actions or steps can be shown through Figure 6 The illustrated device 600 is used to implement this. For example, device 600 may include more modules or units to implement the actions or steps described above, or... Figure 6 Some of the units or modules shown can be further configured to implement the actions or steps described above. This will not be repeated here.
[0050] Figure 7A schematic block diagram of an example device 700 that can be used to implement embodiments of the present disclosure is shown. As shown, device 700 includes a computing unit 701, which can perform various appropriate actions and processes according to computer program instructions stored in read-only memory (ROM) 702 or loaded from storage unit 706 into random access memory (RAM) 703. Various programs and data required for the operation of device 700 may also be stored in RAM 703. The computing unit 701, ROM 702, and RAM 703 are interconnected via bus 704. Input / output (I / O) interface 705 is also connected to bus 704.
[0051] Multiple components in device 700 are connected to I / O interface 705, including: input unit 706, such as keyboard, mouse, etc.; output unit 707, such as various types of monitors, speakers, etc.; storage unit 708, such as disk, optical disk, etc.; and communication unit 709, such as network card, modem, wireless transceiver, etc. Communication unit 709 allows device 700 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0052] The computing unit 701 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 701 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 701 performs the various methods and processes described above, such as method 300. For example, in some embodiments, method 300 may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on device 700 via ROM 702 and / or communication unit 709. When the computer program is loaded into RAM 703 and executed by the computing unit 701, one or more steps of method 300 described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to perform method 300 by any other suitable means (e.g., by means of firmware).
[0053] In some embodiments, the methods and processes described above can be implemented as a computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for performing various aspects of this disclosure.
[0054] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example—but not limited to—electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination thereof. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.
[0055] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper cables, fiber optic cables, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to computer-readable storage media within the respective computing / processing device.
[0056] Computer program instructions used to perform the operations of this disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages and conventional procedural programming languages. The computer-readable program instructions may execute entirely on a user's computer, partially on a user's computer, as a standalone software package, partially on a user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing the status information of the computer-readable program instructions to implement various aspects of this disclosure.
[0057] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processing unit of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0058] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.
[0059] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of devices, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0060] The various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or technical improvements to the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. A method for cleaning up resources, comprising: When a user edits a draft, information about at least one object of the draft is stored in a first set and the at least one object is stored as a weak reference in a second set, wherein each object is linked to a corresponding resource and can be recycled; By comparing the first set and the second set, objects of resources that are not used in the draft are identified; as well as Clean up the resources corresponding to the unused objects.
2. The method according to claim 1, wherein the at least one object has address information, and the information of the at least one object of the draft stored in the first set includes: In response to the addition of resources of the at least one object to the draft, the address information of the at least one object is recorded in the first set.
3. The method of claim 1, wherein the second set comprises a weak reference-based data structure, and storing the at least one object in the second set using weak references includes: In response to the resource of the at least one object being added to the draft, the at least one object is added to the weak reference-based data structure.
4. The method according to claim 1, further comprising: Based on the garbage collection mechanism, the objects of resources that are not referenced by the draft in at least one of the objects are destroyed.
5. The method of claim 4, wherein the garbage collection mechanism ignores weak references of the second set to the at least one object.
6. The method of claim 1, wherein the objects for determining unused resources in the draft include: Identify the destroyed objects in the second set; as well as Based on the information corresponding to the destroyed objects in the first set, determine the objects of resources that are not used in the draft.
7. The method of claim 1, wherein the object for determining unused resources in the draft comprises: In response to determining that the draft is saved, the first set and the second set are compared to determine objects of resources that are not used in the draft.
8. The method according to claim 1, further comprising: After cleaning up the resources corresponding to the unused objects, reset the first set and the second set.
9. A system for cleaning up resources, comprising: The set determination unit is configured to, when a user edits a draft, store information about at least one object of the draft in a first set and store the at least one object with a weak reference in a second set, wherein each object is linked to a corresponding resource and can be recycled; The useless resource determination unit is configured to determine objects of unused resources in the draft by comparing the first set and the second set; as well as The resource cleanup unit is configured to clean up resources corresponding to the unused objects.
10. A computing device, comprising: At least one processing unit; At least one memory coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, the instructions, when executed by the at least one processing unit, causing the computing device to perform the method as described in any one of claims 1 to 8.
11. A computer storage medium comprising machine-executable instructions that, when executed by a device, cause the device to perform the method as claimed in any one of claims 1 to 8.
12. A computer program product comprising machine-executable instructions that, when executed by a device, cause the device to perform the method as described in any one of claims 1 to 8.