A video physical resource deletion method and related device
By scanning the logical deletion table, matching content fingerprints, and verifying multi-dimensional business rules, combined with reverse reference detection, we have achieved accurate and efficient deletion of video physical resources, solving the problems of storage waste and high costs caused by crude deletion in existing technologies.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-26
- Publication Date
- 2026-07-07
AI Technical Summary
In existing technologies, the methods for deleting video physical resources are too crude, resulting in wasted storage space and high costs, and lacking consideration for business logic and data correlation.
By scanning the logical deletion table, identifying identical video files using the content fingerprint of the video files, and performing multi-dimensional business rule verification and reverse reference detection, the video files are physically deleted only after ensuring that they are in a resource-deletable state.
It achieves precise and efficient deletion of physical video resources, avoiding accidental deletion of important video data and reducing storage costs and operational risks.
Smart Images

Figure CN121743288B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of software technology, and in particular to a method and related apparatus for deleting video physical resources. Background Technology
[0002] With the rapid development of internet PUGC platforms, these platforms now house billions of video files and their associated database records. User deletions and content removals generate massive amounts of logically deleted data, which consumes enormous storage space and incurs high costs.
[0003] Therefore, how to accurately and effectively delete video physical resources has become an urgent problem to be solved at this stage. Summary of the Invention
[0004] In view of the above problems, this application provides a method and related apparatus for deleting video physical resources, so as to achieve the purpose of accurately and effectively deleting video physical resources. The specific solution is as follows:
[0005] The first aspect of this application provides a method for deleting video physical resources, the method comprising:
[0006] The first video file of the physical resource to be deleted is determined by scanning the logical deletion table.
[0007] Based on the content fingerprint of the first video file, at least one second video file with the same content is identified, and a business verification is performed on the first video file and the at least one second video file to determine whether the first video file is in a resource deletable state;
[0008] If the first video file is in a state where resources can be deleted, delete the physical resources of the first video file.
[0009] In one possible implementation, the step of performing business verification on the first video file and the at least one second video file to determine whether the first video file is in a resource-deletable state includes:
[0010] Obtain multi-dimensional business rules and verify whether the first video file and the at least one second video file satisfy the multi-dimensional business rules;
[0011] If the first video file or any second video file satisfies the multi-dimensional business rules, it is determined that the first video file is in a resource that cannot be deleted;
[0012] If neither the first video file nor the at least one second video file satisfies the multidimensional business rules, delete the first video file and its content fingerprint, as well as the associated records of the at least one second video file, and perform a reverse reference detection on the first video file. The reverse reference detection result can indicate whether the first video file is in a resource-deletable state.
[0013] In one possible implementation, the reverse reference detection of the first video file includes:
[0014] Based on the content fingerprint of the first video file, the first video file and the at least one second video file are recorded in the first set, and at the same time, a reverse index table is constructed;
[0015] Traverse at least one CDN upload file of the first video file, and query at least one third video file associated with the traversed target CDN upload file from the inverted index table;
[0016] Record the at least one third video file into the second set, and calculate the difference between the first set and the second set;
[0017] If the difference set is empty, it is determined that the first video file has passed the reverse reference detection of the target CDN uploaded file, and the step of traversing at least one CDN uploaded file of the first video file is returned until at least one CDN uploaded file of the first video file has been traversed.
[0018] If the difference set is not empty and at least one video file in the difference set is in a normal working state, it is determined that the first video file has not passed the reverse reference detection of the target CDN uploaded file, and the step of traversing at least one CDN uploaded file of the first video file is returned until at least one CDN uploaded file of the first video file has been traversed.
[0019] If the difference set is not empty and all video files in the difference set are in an abnormal working state, it is determined that the first video file is detected by the reverse reference detection of the target CDN uploaded file, and the step of traversing at least one CDN uploaded file of the first video file is returned until at least one CDN uploaded file of the first video file has been traversed.
[0020] When at least one CDN uploaded file of the first video file has been traversed, the backreference detection result is output, which can indicate whether each CDN uploaded file of the first video file is in a resource deletable state.
[0021] In one possible implementation, the video physical resource deletion method further includes:
[0022] If the first video file fails the reverse reference detection of the target CDN uploaded file, a log record of the target CDN uploaded file is generated based on the reverse index table.
[0023] In one possible implementation, deleting the physical resources of the first video file includes:
[0024] Delete the physical resources of at least one CDN uploaded file of the first video file that is in a removable state.
[0025] A second aspect of this application provides a video physical resource deletion device, the video physical resource deletion device comprising:
[0026] The scanning module is used to determine the first video file of the physical resource to be deleted by scanning the logical deletion table;
[0027] The resource deletion module is used to determine at least one second video file with the same content based on the content fingerprint of the first video file, and to perform business verification on the first video file and the at least one second video file to determine whether the first video file is in a resource-deletable state; if the first video file is in a resource-deletable state, the physical resources of the first video file are deleted.
[0028] In one possible implementation, the resource deletion module for performing business verification on the first video file and the at least one second video file to determine whether the first video file is in a resource-deletable state is specifically used for:
[0029] Obtain multi-dimensional business rules and verify whether the first video file and at least one second video file satisfy the multi-dimensional business rules; if the first video file or any second video file satisfies the multi-dimensional business rules, determine that the first video file is in a resource-undeletable state; if neither the first video file nor the at least one second video file satisfies the multi-dimensional business rules, delete the first video file and its content fingerprint, as well as the associated records of the at least one second video file, and perform reverse reference detection on the first video file. The reverse reference detection result can indicate whether the first video file is in a resource-deletable state.
[0030] A third aspect of this application provides a computer program product including computer-readable instructions that, when executed on an electronic device, cause the electronic device to implement the video physical resource deletion method described in the first aspect or any implementation thereof.
[0031] A fourth aspect of this application provides an electronic device, including at least one processor and a memory connected to the processor, wherein:
[0032] The memory is used to store computer programs;
[0033] The processor is used to execute the computer program so that the electronic device can implement the video physical resource deletion method described in the first aspect or any implementation thereof.
[0034] The fifth aspect of this application provides a computer storage medium carrying one or more computer programs that, when executed by an electronic device, enable the electronic device to perform a video physical resource deletion method as described in the first aspect or any implementation thereof.
[0035] By employing the above technical solution, this application provides a method and related apparatus for deleting physical video resources, comprising: determining a first video file whose physical resources are to be deleted by scanning a logical deletion table; determining at least one second video file with the same content based on the content fingerprint of the first video file, and performing business verification on the first video file and at least one second video file to determine whether the first video file is in a resource-deletable state; and deleting the physical resources of the first video file if the first video file is in a resource-deletable state. This application performs secure, accurate, and efficient physical deletion of massive amounts of logically deleted video files based on content fingerprints and business requirements, avoiding the accidental deletion of seemingly "useless" but business-valuable video data. Attached Figure Description
[0036] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.
[0037] Figure 1 A flowchart illustrating a video physical resource deletion method provided in an embodiment of this application;
[0038] Figure 2 This is a partial flowchart illustrating a video physical resource deletion method provided in an embodiment of this application;
[0039] Figure 3 This is another schematic flowchart of a video physical resource deletion method provided in an embodiment of this application;
[0040] Figure 4A schematic diagram of a video physical resource deletion device provided in an embodiment of this application;
[0041] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0042] The embodiments of this application are described below with reference to the accompanying drawings. The terminology used in the implementation section of this application is for explaining specific embodiments only and is not intended to limit the scope of this application.
[0043] The embodiments of this application will now be described with reference to the accompanying drawings. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.
[0044] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements, but may include other elements not explicitly listed or inherent to those processes, methods, products, or apparatuses.
[0045] To facilitate understanding of this application, the relevant concepts involved in this application will be explained below:
[0046] PUGC (Professional User Generated Content) videos: Videos produced by professional users, not copyrighted videos.
[0047] VRS: Non-user-uploaded copyrighted videos.
[0048] Logical deletion: A data deletion method in which data is marked as "deleted" only in the database, while the actual physical data remains in the storage system.
[0049] Physical deletion: A thorough way to delete data, which not only deletes the records in the database, but also permanently deletes the corresponding physical files from the storage medium (such as CDN).
[0050] MD5: A widely used hash algorithm. The PUGC platform uses it to generate a unique "digital fingerprint" for video files. Video files with identical content will have the same MD5 value, and the PUGC platform uses MD5 to remove duplicates.
[0051] MD5 multi-version association: This refers to identifying videos with the same content by calculating the MD5 value of the files, and maintaining the mapping relationship between multiple versions of video files and the same physical resource in the system through tables such as vid_md5 and md5info.
[0052] CDN (Content Delivery Network): A distributed network used to quickly deliver static resources such as videos and images to users.
[0053] File ID (fileid): This is a unique identifier assigned by the PUGC platform to each CDN uploaded file, used to locate the specific resource on the CDN. A video file can be divided into multiple CDN uploaded files by the PUGC platform.
[0054] Security Audit Sample Library: A collection of video samples retained by the platform for training, testing, and optimizing security audit models, which has significant business value.
[0055] Video replacement: The platform supports users in replacing the source video file. The original video is called the source video, and the newly uploaded video is called the target video.
[0056] Live replay video: The replay video generated after the live stream ends. It is distinguished by a specific value of uploadfrom and may be used as the source material for screen recording videos.
[0057] Screen recording video: Videos uploaded by users through screen recording, which are not transcoded by the platform and are distinguished by a specific value of uploadfrom.
[0058] Currently, regularly physically deleting logically deleted data on the PUGC platform to free up storage space has become a key measure for reducing costs and increasing efficiency in the PUGC platform. At present, various automated cleanup solutions have emerged in the field of data lifecycle management, and their technological evolution is moving from simple and crude batch deletion to more refined methods.
[0059] Traditional solutions typically employ a timed scanning and batch deletion strategy. This involves periodically scanning the logical deletion table (such as videoinfo_del) and, for video files that meet time criteria (such as "deleted more than 3 years ago"), directly calling the deletion interface to batch delete their records in the database and their physical files on the CDN. While this approach is simple to implement, it is too crude and lacks consideration for business logic and data relationships.
[0060] To address the aforementioned problems, this application provides a method for deleting video physical resources. The method for deleting video physical resources according to this application will be described in detail below with reference to the accompanying drawings.
[0061] See Figure 1 , Figure 1 This is a flowchart illustrating a video physical resource deletion method provided in an embodiment of this application. Figure 1 As shown in the figure, the video physical resource deletion method provided in this application embodiment may include steps S101 to S103, which are described in detail below.
[0062] S101, determine the first video file of the physical resource to be deleted by scanning the logical deletion table.
[0063] In this embodiment of the application, the logical deletion table records the relevant data of the logically deleted video files. Scanning the logical deletion table can filter out video files that meet the time condition (such as "deleted 3 years ago"). The filtered video file is the first video file.
[0064] S102, determine at least one second video file with the same content based on the content fingerprint of the first video file, and perform business verification on the first video file and at least one second video file to determine whether the first video file is in a resource deletable state.
[0065] In this application, the content fingerprint of the first video file can be determined by calculating its MD5 value. Since the PUGC platform has maintained the mapping relationship between multiple versions of video files and the same physical resource through MD5 multi-version association, at least one video file with the same content (i.e. sharing the same physical resource) can be identified through the content fingerprint of the first video file, namely at least one second video file.
[0066] Furthermore, a business verification is performed on the first video file and at least one second video file to determine whether the first video file and at least one second video file have business requirements. If any one of the first video file and at least one second video file has business requirements, the first video file is determined to be in a resource that cannot be deleted. Conversely, if neither the first video file nor the second video file has business requirements, the first video file is determined to be in a resource that can be deleted.
[0067] In addition, if the content fingerprint of the first video file determines that there are no other video files with the same content in the PUGC platform, then only the first video file is checked for business requirements to determine whether it meets the business requirements. If the first video file meets the business requirements, it is determined that it is in a resource that cannot be deleted. Conversely, if the first video file does not meet the business requirements, it is determined that it is in a resource that cannot be deleted.
[0068] S103, if the first video file is in a resource-deletable state, delete the physical resources of the first video file.
[0069] In this embodiment, if the first video file is in a removable resource state, its physical resources in the corresponding storage (such as CDN) can be deleted to free up relevant space. Specifically, the CDN address and screenshot address of at least one CDN-uploaded file corresponding to the first video file can be exported to the corresponding storage for physical deletion.
[0070] In one possible implementation, after performing business-level validation on the first video file and at least one second video file, a backreference detection can be used to determine whether the first video file is still being referenced by a legitimate video, thus preventing the risk of accidental deletion. See also Figure 2 , Figure 2 This is a partial flowchart illustrating a video physical resource deletion method provided in an embodiment of this application. Figure 2 As shown in the embodiment of this application, a video physical resource deletion method is provided. In step S102, "perform business verification on the first video file and at least one second video file to determine whether the first video file is in a resource deletable state", which may include steps S201 to S203. These steps are described in detail below.
[0071] S201, obtain the multi-dimensional business rules and verify whether the first video file and at least one second video file meet the multi-dimensional business rules.
[0072] In this embodiment, an address whitelist and a file identifier whitelist can be established during the preprocessing stage. The address whitelist records the resource addresses of specified CDN uploaded files in the corresponding storage, and the file identifier whitelist records the file identifiers of specified CDN uploaded files. For example, CDN addresses shared by the VRS service and the PUGC platform, two independent services, can be added to the address whitelist. Additionally, file addresses of CDN uploaded files with different file identifiers but the same CDN address can be added to the file identifier whitelist.
[0073] During the decision-making stage, multi-dimensional business rules are introduced to determine the first video file and at least one second video file with the same content fingerprint. Specifically, for the first video file, since it has been logically deleted (not in a normal state) and meets the time condition, the multi-dimensional business rules are used to further verify whether the video is a long audio file, whether the video is in the security audit sample library, whether the video is a live playback video and is associated with a screen recording video as the source video, whether the video is a screen recording video, whether the video is a replacement source video, and whether the CDN upload file corresponding to the video is in the address whitelist and file identifier whitelist.
[0074] If the first video file is not a long audio file, is not in the security audit sample library, is not a live replay video, or is a live replay video but is not associated with a screen recording video as the source video, is not a screen recording video, is not a replacement source video, and the corresponding CDN upload file is not in the address whitelist or file identifier whitelist, then the first video file is determined to not meet the multi-dimensional business rules. Conversely, if the first video file is a long audio file, or is in the security audit sample library, or is a live replay video and is associated with a screen recording video as the source video, or is a screen recording video, or is a replacement source video, or the corresponding CDN upload file is in the address whitelist or file identifier whitelist, then the first video file is determined to meet the multi-dimensional business rules.
[0075] In addition, for the second video file, based on multi-dimensional business rules, we verify whether the video is in a normal state, whether the video meets the time conditions, whether the video is a long audio file, whether the video is in the security audit sample library, whether the video is a live replay video and is associated with a screen recording video as the source video, whether the video is a screen recording video, whether the video is a replacement source video, and whether the CDN upload file corresponding to the video is in the address whitelist and file identifier whitelist.
[0076] If the second video file is not in a normal state, meets the time requirement, is not a long audio file, is not in the security audit sample library, is not a live replay video, or is a live replay video but is not associated with a screen recording video as the source video, is not a screen recording video, is not a replacement source video, and the corresponding CDN upload file is not in the address whitelist or file identifier whitelist, then the second video file is determined to not meet the multi-dimensional business rules. Conversely, if the second video is in a normal state, or does not meet the time requirement, is a long audio file, is in the security audit sample library, is a live replay video and is associated with a screen recording video as the source video, is a screen recording video, is a replacement source video, or the corresponding CDN upload file is in the address whitelist or file identifier whitelist, then the second video file is determined to meet the multi-dimensional business rules.
[0077] S202, if the first video file or any second video file satisfies the multi-dimensional business rules, determine that the first video file is in a resource-undeletable state.
[0078] In this embodiment of the application, if the first video or any second video file satisfies the multi-dimensional business rules, its corresponding content fingerprint is marked as "cannot be deleted", and the deletion of database records and physical resources is not allowed. At this time, it is determined that the first video file is in a resource-undeletable state.
[0079] In practical applications, for at least one second video file, since it shares the same content fingerprint as the first video file, a "state propagation" mechanism can be used for rule determination. When any second video file satisfies the multi-dimensional business rules, it can be determined that the first video file is in a resource-undeletable state.
[0080] S203, if neither the first video file nor at least one second video file satisfies the multidimensional business rules, delete the first video file and its content fingerprint, as well as the associated record of at least one second video file, and perform a reverse reference detection on the first video file. The reverse reference detection result can indicate whether the first video file is in a resource-deletable state.
[0081] In this embodiment, if neither the first video file nor at least one second video file satisfies the multi-dimensional business rules, then their corresponding content fingerprints are marked as "deletable." The first video file, its content fingerprint, and the associated records of at least one second video file in the database are deleted. A reverse reference detection is performed on the first video file using at least one CDN uploaded file corresponding to the first video file to determine whether all associated records of all video files corresponding to at least one CDN uploaded file have been deleted. If so, the first video file is determined to have passed the reverse reference detection and is in a resource-deletable state; otherwise, if not, the first video file is determined to have failed the reverse reference detection and is in a resource-undeletable state.
[0082] In one possible implementation, a difference analysis can be performed by constructing an inverted index table to detect whether the CDN-uploaded file corresponding to the first video file is still being referenced by the normal video, thus preventing the risk of accidental deletion. See also Figure 3 , Figure 3 This is another schematic flowchart illustrating a video physical resource deletion method provided in an embodiment of this application. Figure 3 As shown in the embodiment of this application, a video physical resource deletion method is provided, wherein step S203, "reverse reference detection of the first video file", may include steps S301 to S307, which are described in detail below.
[0083] S301, according to the content fingerprint of the first video file, record the first video file and at least one second video file into the first set, and at the same time, construct a reverse index table.
[0084] In this embodiment, the video identifier of the first video file and the video identifier of at least one second video file are recorded in a set corresponding to their content fingerprints (i.e., the first set). That is, one first set corresponds to one content fingerprint; all video files in the first set share the same content fingerprint, and all video files in the first set share at least one CDN uploaded file. Additionally, the file identifier, CDN address, and screenshot address of at least one CDN uploaded file corresponding to the first video file are obtained.
[0085] At the same time, an inverted index table is constructed. Specifically, composite fields (such as comma-separated fileids) in key databases (such as video_version, videoinfo, md5info, etc.) are processed by ETL, decomposed, and stored in structured intermediate tables (such as fileids_vv, fileids_videoinfo, fileids_md5info) to obtain the inverted index table.
[0086] S302, traverse at least one CDN upload file of the first video file, and query at least one third video file associated with the traversed target CDN upload file from the inverted index table.
[0087] In this embodiment, after scanning the logical deletion table, the file identifier, CDN address, and screenshot address of the first set and at least one corresponding CDN uploaded file are further encapsulated into a message and sent to the RocketMQ message queue. The consumer consumes the messages in the RocketMQ message queue and records them in the relevant data table. Thus, at least one CDN uploaded file corresponding to the first set is traversed, and for each target CDN uploaded file traversed, the video identifier of at least one associated video file (i.e., the third video file) can be retrieved from the inverted index table based on its file identifier.
[0088] S303, record at least one third video file into the second set, and calculate the difference between the first set and the second set.
[0089] In this embodiment of the application, the video identifier of at least one third video file is recorded in another set (i.e., the second set), and the difference between the first set and the second set is calculated to determine whether the difference is empty.
[0090] S304, if the difference set is empty, determine that the first video file has passed the reverse reference detection of the target CDN uploaded file, and return to execute step S302 until at least one CDN uploaded file of the first video file has been traversed.
[0091] In this embodiment of the application, if the difference set is empty, it is determined that the first video file is detected by the reverse reference detection of the target CDN uploaded file, that is, the target CDN uploaded file is in a resource deletable state. At this time, the file identifier of the target CDN file can be marked as "deletable", and the execution step S302 is returned until all CDN files of the first video file have been traversed.
[0092] S305, if the difference set is not empty and at least one video file in the difference set is in a normal working state, determine that the first video file has not passed the reverse reference detection of the target CDN uploaded file, and return to execute step S302 until at least one CDN uploaded file of the first video file has been traversed.
[0093] In this embodiment, if the difference set is not empty, the file identifiers of each video file in the difference set are traversed to check whether its working status is normal. If the working status of any video file in the difference set is normal, it is determined that the first video file has not passed the reverse reference detection of the target CDN uploaded file, that is, the target CDN uploaded file is in a resource that cannot be deleted. At this time, the file identifier of the target CDN file can be marked as "cannot be deleted", and the execution step S302 is returned until all CDN files of the first video file have been traversed.
[0094] S306, if the difference set is not empty and the working status of all video files in the difference set is abnormal, determine that the first video file is detected by the reverse reference of the target CDN uploaded file, and return to step S302 until at least one CDN uploaded file of the first video file has been traversed.
[0095] In this embodiment, if the difference set is not empty, the file identifiers of each video file in the difference set are traversed to check whether their working status is normal. If the working status of all video files in the difference set is normal, it is determined that the first video file has passed the reverse reference detection of the target CDN uploaded file, that is, the target CDN uploaded file is in the resource deletable state. At this time, the file identifier of the target CDN file can be marked as "deletable", and the execution of step S302 is returned until all CDN files of the first video file have been traversed.
[0096] S307, after at least one CDN uploaded file of the first video file has been traversed, output the backreference detection result. The backreference detection result can indicate whether each CDN uploaded file of the first video file is in a resource deletable state.
[0097] In this embodiment of the application, when at least one CDN uploaded file corresponding to the first video file has been traversed, the reverse reference detection result of the first video file can be output. The reverse reference detection result can indicate whether each CDN uploaded file corresponding to the first video file is in a resource deletable state or in a resource non-deletable state.
[0098] Based on this, corresponding log records can be generated according to the type of the inverted index table. In this regard, the video physical resource deletion method provided in this application embodiment further includes the following steps:
[0099] If the first video file fails the reverse reference detection of the target CDN uploaded file, log records of the target CDN uploaded file are generated based on the reverse index table.
[0100] In the implementation of this application, if the first video file fails the reverse reference detection of the target CDN uploaded file, that is, the file identifier of the target CDN uploaded file is marked as "cannot be deleted", then a log record of the target CDN uploaded file can be generated according to the reverse index table. This log record can indicate that the reverse index table is the reason why the target CDN uploaded file is in a resource that cannot be deleted.
[0101] Furthermore, after determining whether each CDN uploaded file in the first video file is in a state where it can be deleted or cannot be deleted, the CDN addresses and screenshot addresses of all CDN files in the state where they can be deleted can be exported to the corresponding storage for physical deletion. In this regard, the video physical resource deletion method provided in this application embodiment further includes the following steps:
[0102] Delete the physical resources of at least one CDN uploaded file that is in a removable state for the first video file.
[0103] Based on the above description, the video physical resource deletion method provided in this application avoids accidental deletion of resources due to misjudgment caused by a single condition through joint judgment of multi-dimensional business rules; ensures the security of videos with the same content through the propagation mechanism of content indicators; and compensates for omissions in previous judgments through reverse reference detection. This application can significantly improve the accuracy of deletion operations and system stability, and reduce operation and maintenance risks and compliance costs.
[0104] The above describes a video physical resource deletion method provided by the embodiments of this application. The following will describe the apparatus for performing the above video physical resource deletion method.
[0105] See Figure 4 , Figure 4 This is a schematic diagram of a video physical resource deletion device provided in an embodiment of this application. Figure 4As shown in the figure, an embodiment of this application provides a video physical resource deletion device, comprising:
[0106] Scanning module 401 is used to determine the first video file of the physical resource to be deleted by scanning the logical deletion table;
[0107] The resource deletion module 402 is used to determine at least one second video file with the same content based on the content fingerprint of the first video file, and to perform business verification on the first video file and at least one second video file to determine whether the first video file is in a resource-deletable state; if the first video file is in a resource-deletable state, the physical resources of the first video file are deleted.
[0108] In one possible implementation, the resource deletion module 402, used to perform business verification on the first video file and at least one second video file to determine whether the first video file is in a resource-deletable state, is specifically used for:
[0109] Obtain multi-dimensional business rules and verify whether the first video file and at least one second video file meet the multi-dimensional business rules; if the first video file or any second video file meets the multi-dimensional business rules, determine that the first video file is in a resource that cannot be deleted; if neither the first video file nor at least one second video file meets the multi-dimensional business rules, delete the first video file and its content fingerprint, as well as the associated record of at least one second video file, and perform a reverse reference detection on the first video file. The reverse reference detection result can indicate whether the first video file is in a resource that can be deleted.
[0110] In one possible implementation, the resource deletion module 402 for detecting backreferences to the first video file is specifically used for:
[0111] Based on the content fingerprint of the first video file, record the first video file and at least one second video file into a first set, and simultaneously construct a reverse index table; traverse at least one CDN uploaded file of the first video file, and query the reverse index table for at least one third video file associated with the traversed target CDN uploaded file; record at least one third video file into a second set, and calculate the difference between the first set and the second set; if the difference is empty, determine that the first video file has passed the reverse reference detection of the target CDN uploaded file, and return to the step of traversing at least one CDN uploaded file of the first video file; if the difference is not empty and at least one video file is found in the difference, proceed with the following steps: If the status is normal, determine that the first video file has not passed the reverse reference detection of the target CDN uploaded file, and return to the step of traversing at least one CDN uploaded file of the first video file; if the difference set is not empty and the working status of all video files in the difference set is abnormal, determine that the first video file has passed the reverse reference detection of the target CDN uploaded file, and return to the step of traversing at least one CDN uploaded file of the first video file; if at least one CDN uploaded file of the first video file has been traversed, output the reverse reference detection result, which can indicate whether each CDN uploaded file of the first video file is in a resource deletable state.
[0112] In one possible implementation, the resource deletion module 402 is also used for:
[0113] If the first video file fails the reverse reference detection of the target CDN uploaded file, log records of the target CDN uploaded file are generated based on the reverse index table.
[0114] In one possible implementation, the resource deletion module 402 for deleting the physical resources of the first video file is specifically used for:
[0115] Delete the physical resources of at least one CDN uploaded file that is in a removable state for the first video file.
[0116] It should be noted that the detailed functions of each module in the embodiments of this application can be found in the corresponding disclosure of the above-mentioned video physical resource deletion method embodiments, and will not be repeated here.
[0117] This application also provides an electronic device in its embodiments. See also... Figure 5 , Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device in this embodiment may include, but is not limited to, fixed terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Figure 5The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0118] like Figure 5 As shown, the electronic device may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. When the electronic device is powered on, the RAM 503 also stores various programs and data required for the operation of the electronic device. The processing unit 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0119] Typically, the following devices can be connected to I / O interface 505: input devices 506 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 507 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 508 including, for example, memory cards, hard drives, etc.; and communication devices 509. Communication device 509 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 5 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.
[0120] This application also provides a computer program product including computer-readable instructions, which, when executed on an electronic device, cause the electronic device to implement any of the video physical resource deletion methods provided in this application.
[0121] This application also provides a computer-readable storage medium carrying one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any of the video physical resource deletion methods provided in this application.
[0122] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.
[0123] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0124] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.
[0125] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).
Claims
1. A method for deleting video physical resources, characterized in that, The video physical resource deletion method includes: The first video file of the physical resource to be deleted is determined by scanning the logical deletion table. Based on the content fingerprint of the first video file, at least one second video file sharing the same physical resource is determined, and multi-dimensional business rules are obtained. The first video file and the at least one second video file are then verified to meet the multi-dimensional business rules. If the first video file or any second video file satisfies the multi-dimensional business rules, it is determined that the first video file is in a resource that cannot be deleted; If neither the first video file nor the at least one second video file satisfies the multidimensional business rules, delete the first video file and its content fingerprint, as well as the associated records of the at least one second video file in the database, and record the first video file and the at least one second video file into the first set according to the content fingerprint of the first video file. At the same time, construct an inverted index table. Traverse at least one CDN upload file of the first video file, and query at least one third video file associated with the traversed target CDN upload file from the inverted index table; Record the at least one third video file into the second set, and calculate the difference between the first set and the second set; If the difference set is empty, it is determined that the first video file has passed the reverse reference detection of the target CDN uploaded file, and the step of traversing at least one CDN uploaded file of the first video file is returned until at least one CDN uploaded file of the first video file has been traversed. If the difference set is not empty and at least one video file in the difference set is in a normal working state, it is determined that the first video file has not passed the reverse reference detection of the target CDN uploaded file, and the step of traversing at least one CDN uploaded file of the first video file is returned until at least one CDN uploaded file of the first video file has been traversed. If the difference set is not empty and all video files in the difference set are in an abnormal working state, it is determined that the first video file is detected by the reverse reference detection of the target CDN uploaded file, and the step of traversing at least one CDN uploaded file of the first video file is returned until at least one CDN uploaded file of the first video file has been traversed. When at least one CDN uploaded file of the first video file has been traversed, the reverse reference detection result is output. The reverse reference detection result can indicate whether each CDN uploaded file of the first video file is in a resource deletable state. If the first video file is in a state where resources can be deleted, delete the physical resources of the first video file.
2. The video physical resource deletion method according to claim 1, characterized in that, The video physical resource deletion method also includes: If the first video file fails the reverse reference detection of the target CDN uploaded file, a log record of the target CDN uploaded file is generated based on the reverse index table.
3. The video physical resource deletion method according to claim 1, characterized in that, Deleting the physical resources of the first video file includes: Delete the physical resources of at least one CDN uploaded file of the first video file that is in a removable state.
4. A video physical resource deletion device, characterized in that, The video physical resource deletion device includes: The scanning module is used to determine the first video file of the physical resource to be deleted by scanning the logical deletion table; The resource deletion module is used to determine at least one second video file sharing the same physical resource based on the content fingerprint of the first video file, and to perform business verification on the first video file and the at least one second video file to determine whether the first video file is in a resource-deletable state; if the first video file is in a resource-deletable state, the physical resource of the first video file is deleted. The resource deletion module, used to perform business verification on the first video file and the at least one second video file to determine whether the first video file is in a resource-deletable state, is specifically used for: The process involves: acquiring multi-dimensional business rules and verifying whether the first video file and at least one second video file satisfy the multi-dimensional business rules; determining that the first video file is in a resource-undeletable state if either the first video file or any second video file satisfies the multi-dimensional business rules; deleting the first video file, its content fingerprint, and the associated records of the at least one second video file in the database, and recording the first video file and the at least one second video file in a first set according to the content fingerprint of the first video file, while simultaneously constructing a reverse index table; traversing at least one CDN uploaded file of the first video file and querying at least one third video file associated with the traversed target CDN uploaded file from the reverse index table; recording the at least one third video file in a second set and calculating the difference between the first set and the second set; if the difference is empty, determining that the first video file passes the reverse reference detection of the target CDN uploaded file, and returning to execute the traversal... The process of iterating through at least one CDN upload file of the first video file continues until all at least one CDN upload file of the first video file has been traversed. If the difference set is not empty and at least one video file in the difference set is in a normal working state, it is determined that the first video file has not passed the backreference detection of the target CDN upload file. The process then returns to the step of iterating through at least one CDN upload file of the first video file until all at least one CDN upload file of the first video file has been traversed. If the difference set is not empty and all video files in the difference set are in an abnormal working state, it is determined that the first video file has passed the backreference detection of the target CDN upload file. The process then returns to the step of iterating through at least one CDN upload file of the first video file until all at least one CDN upload file of the first video file has been traversed. When at least one CDN upload file of the first video file has been traversed, the backreference detection result is output, indicating whether each CDN upload file of the first video file is in a resource deletable state.
5. A computer program product, characterized in that, Includes computer-readable instructions that, when executed on an electronic device, cause the electronic device to implement the video physical resource deletion method as described in any one of claims 1 to 3.
6. An electronic device, characterized in that, It includes at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program to enable the electronic device to implement the video physical resource deletion method as described in any one of claims 1 to 3.
7. A computer storage medium, characterized in that, The storage medium carries one or more computer programs that, when executed by an electronic device, enable the electronic device to implement the video physical resource deletion method as described in any one of claims 1 to 3.
Citation Information
Patent Citations
Resource file deletion method, device and equipment for application slimming
CN118445261A