Multimedia resource validity verification method, terminal device and storage medium

By simulating user behavior and asynchronous concurrency technology to dynamically obtain multimedia URLs, the lag problem of the multimedia download model during protocol changes is solved, timely validation and automated monitoring of multimedia resources are realized, and detection efficiency and accuracy are improved.

CN120416232APending Publication Date: 2025-08-01SHENZHEN MAIFENG TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202510485433.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-17
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

The existing multimedia download model relies on specific multimedia URL parsing and downloading mechanisms, which leads to prone to failure when the download protocol changes. The traditional validity verification method has lag and problems cannot be discovered in time.

Method used

By simulating real user behavior, traversing the multimedia platform, dynamically obtaining the multimedia URL under the latest protocol, using asynchronous concurrency technology to perform state detection of massive links and instant judgment of response status codes, generating resource lists and attaching metadata such as expiration time and authentication status to achieve automated multimedia resource validity verification.

Benefits of technology

It significantly improves the efficiency and accuracy of multimedia resource effectiveness verification, promptly detects and fixes problems, reduces the probability of users perceived failures, and supports large-scale detection needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120416232A_ABST
    Figure CN120416232A_ABST
Patent Text Reader

Abstract

The invention is suitable for the field of data processing, and discloses a multimedia resource validity verification method, terminal equipment and a storage medium. The multimedia resource validity verification method comprises the following steps: traversing a plurality of resource pages of a plurality of multimedia platforms, wherein the traversing operation is realized by simulating a browser click operation; collecting a resource link set corresponding to the plurality of resource pages; accessing each resource link in the resource link set to obtain a response state code set; and according to the response state code set, allocating a validity state identifier to each resource link to obtain an identifier set, the identifier set comprising a valid identifier and / or an invalid identifier. According to the invention, the problem discovery node can be actively monitored from the user side to the development side before complaint, so that the effectiveness of the multimedia resource can be timely monitored.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of data processing, and particularly relates to a method for validating the effectiveness of multimedia resources, a terminal device, and a storage medium. Background Art

[0002] The download protocols of different multimedia platforms are different, and existing multimedia download models usually rely on specific multimedia URL parsing and download mechanisms. However, once the download protocols of these platforms change, the function of downloading multimedia files may fail. Such failures are often the first to be perceived by users. Using user feedback as a trigger condition for emergency repair, it can be seen that the traditional effectiveness verification method has hysteresis. A new technical means is needed to solve the above technical problems. Summary of the Invention

[0003] In view of this, embodiments of the present invention provide a method for validating the effectiveness of multimedia resources, a terminal device, and a storage medium, which can solve the problem of hysteresis in the traditional effectiveness verification method in related technologies.

[0004] The first aspect of the present invention provides a method for validating the effectiveness of multimedia resources, including:

[0005] Traverse multiple resource pages of multiple multimedia platforms, and the traversal operation is implemented by simulating browser click operations;

[0006] Collect a set of resource links corresponding to the multiple resource pages;

[0007] Access each resource link in the set of resource links to obtain a set of response status codes;

[0008] According to the set of response status codes, assign an effectiveness status identifier to each resource link to obtain a set of identifiers, and the set of identifiers includes valid identifiers and / or invalid identifiers.

[0009] Optionally, in the first implementation manner of the first aspect of the present invention, after the step of assigning an effectiveness status identifier to each resource link according to the set of response status codes to obtain a set of identifiers, the method further includes:

[0010] Generate a resource list according to the set of identifiers, and the resource list includes valid download links determined in the set of resource links and status information of the valid download links, where the status information includes an expiration time and / or whether authentication is required.

[0011] Optionally, in the second implementation manner of the first aspect of the present invention, the step of collecting a set of resource links corresponding to the multiple resource pages includes:

[0012] Perform a resource link collection operation on the multiple multimedia platforms in a distributed manner to obtain multimedia information. The distributed operation is implemented through the asyncio module and the concurrent.futures module;

[0013] Store the multimedia information in a dictionary structure and write it to an intermediate file in YAML format through the yaml.dump method to obtain the resource link set.

[0014] Optionally, in the third implementation manner of the first aspect of the present invention, the step of accessing each resource link in the resource link set to obtain a response status code set includes:

[0015] Split the resource link set into a first link set and a second link set. Each first resource link in the first link set corresponds to a first multimedia platform that requires login authentication, and each second resource link in the second link set corresponds to a second multimedia platform that does not require login authentication;

[0016] Send a first HTTP request to each of the first resource links and a second HTTP request to each of the second resource links to obtain the response status code set. The request header of the first HTTP request is injected with the cookie verification token corresponding to the access target in the first multimedia platform.

[0017] Optionally, in the fourth implementation manner of the first aspect of the present invention, the step of assigning a validity status identifier to each resource link according to the response status code set to obtain an identifier set includes:

[0018] According to the valid status codes and invalid status codes in the response status code set, split the resource link set into a valid link set and an invalid link set;

[0019] Assign the valid identifier to the valid link set and the invalid identifier to the invalid link set to obtain the identifier set.

[0020] Optionally, in the fifth implementation manner of the first aspect of the present invention, the step of splitting the resource link set into a valid link set and an invalid link set according to the valid status codes and invalid status codes in the response status code set includes:

[0021] Split out a third link set from the resource link set according to the valid status codes in the response status code set, and split out a fourth link set from the resource link set according to the invalid status codes in the response status code set;

[0022] If there are abnormal links in the third link set, move the abnormal links to the fourth link set to obtain the valid link set and the invalid link set respectively. The valid link set is the updated third link set, and the invalid link set is the updated fourth link set. The resource data corresponding to the abnormal links is determined to be abnormal.

[0023] Optionally, in the sixth implementation manner of the first aspect of the present invention, before the step of if there are abnormal links in the third link set, move the abnormal links to the fourth link set to obtain the valid link set and the invalid link set respectively, the method further includes:

[0024] Detect whether there is abnormal data in the resource set corresponding to the third link set, where the abnormal data includes tampered data, incomplete data, and / or sensitive data;

[0025] If there is the abnormal data, determine the link corresponding to the abnormal data as the abnormal link.

[0026] Optionally, in the seventh implementation manner of the first aspect of the present invention, the step of traversing the resource pages of multiple multimedia platforms further includes:

[0027] Periodically traverse the resource pages of multiple multimedia platforms.

[0028] In a second aspect, an embodiment of the present invention provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the above-mentioned method for validating the effectiveness of multimedia resources are implemented.

[0029] In a third aspect, an embodiment of the present invention provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned method for validating the effectiveness of multimedia resources are implemented.

[0030] In a fourth aspect, an embodiment of the present invention provides a computer program product, which when running on a terminal device, causes the terminal device to execute the above-mentioned method for validating the effectiveness of multimedia resources.

[0031] The beneficial effects of the embodiments of the present invention compared with the prior art are as follows: By simulating real user behaviors to traverse heterogeneous platforms and dynamically obtaining multimedia URLs under the latest protocol, the adaptability defect of the fixed parsing mechanism to protocol changes is overcome; Through asynchronous concurrent technology, batch status detection of a large number of links and instant determination of response status codes are realized, which can significantly improve the efficiency of effectiveness verification, and can move the problem discovery node from user-side complaints to proactive monitoring on the development side, realizing timely monitoring of the effectiveness of multimedia resources. Brief Description of the Drawings

[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0033] Figure 1 It is a schematic diagram of an embodiment of the method for validating the effectiveness of multimedia resources in an embodiment of the present invention;

[0034] Figure 2 It is a schematic diagram of a specific embodiment of step S102 of the method for validating the effectiveness of multimedia resources in an embodiment of the present invention;

[0035] Figure 3 It is a schematic diagram of a specific embodiment of step S103 of the method for validating the effectiveness of multimedia resources in an embodiment of the present invention;

[0036] Figure 4 It is a schematic diagram of a specific embodiment of step S104 of the method for validating the effectiveness of multimedia resources in an embodiment of the present invention;

[0037] Figure 5 It is a schematic diagram of an embodiment of a terminal device in an embodiment of the present invention. Detailed Description of the Embodiments

[0038] In order to make the purpose, technical solutions and advantages of the present invention more clear, the following further details the present invention in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the protection scope of the present invention.

[0039] It should be noted that the terms "including", "comprising", "having" and any variations thereof in the description, claims and above-mentioned drawings of the present invention are intended to cover non-exclusive inclusion. For example, a process, method, terminal, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally further include steps or units not listed, or may optionally further include other steps or units inherent to these processes, methods, products or devices. In the claims, description and drawings of the present invention, relational terms such as "first" and "second" are only used to distinguish one entity / operation / object from another entity / operation / object, and do not necessarily require or imply any such actual relationship or order between these entities / operations / objects.

[0040] Reference to "embodiment" herein means that a particular feature, structure or characteristic described in connection with the embodiment can be included in at least one embodiment of the present invention. The phrase appears in various places in the specification and does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0041] The download protocols of different multimedia platforms are different, and existing multimedia download models usually rely on specific multimedia URL parsing and download mechanisms. However, once the download protocols of these platforms change, the function of downloading multimedia files may fail. Such failures are often the first to be perceived by users. Triggering emergency repairs based on user feedback shows that there is a lag in traditional validity verification methods. A new technical means is needed to solve the above technical problems.

[0042] In view of this, an embodiment of the present invention provides a method for validating the effectiveness of multimedia resources, a terminal device and a storage medium, with yy beneficial effects.

[0043] In order to illustrate the technical solution of the present invention, specific embodiments will be used for illustration below.

[0044] Figure 1 Fig. shows a schematic flowchart of the implementation of a method for validating the effectiveness of multimedia resources provided by an embodiment of the present invention. This method can be applied to a terminal device. The terminal device can be a mobile phone, a tablet computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, etc.

[0045] Specifically, the method for validating the effectiveness of the above-mentioned multimedia resources may include the following steps S101 to S104.

[0046] Step S101, traverse the resource pages of multiple multimedia platforms. The traversal operation is implemented by simulating browser click operations.

[0047] In an embodiment of the present invention, the terminal device (the multimedia resource validity verification device) simulates real user operations through a headless browser (such as based on the Playwright framework), and sequentially accesses different resource pages of multiple multimedia platforms. For example, for a video platform, automatically click on classification labels such as "Movies" and "TV Series" to trigger page jumps and load dynamic content (such as VIP resource pages returned by AJAX requests). During the traversal process, the browser instance performs page rendering, JavaScript parsing, and Cookie management to ensure that restricted resource links in the logged-in state can be obtained.

[0048] Step S102, collect the resource link sets corresponding to the multiple resource pages.

[0049] In an embodiment of the present invention, after the browser finishes loading the page, according to a preset DOM element selection rule (such as using a CSS selector to locate elements of the.download-link class), the original resource links are extracted from the page.

[0050] The extracted links are cleaned by regular expressions (such as removing URL parameters and filtering illegal characters), and organized into structured dictionary data according to the platform name and resource type (such as MP4, MP3). The cleaned link set is temporarily stored in a memory queue waiting for subsequent processing.

[0051] Step S103, access each resource link in the resource link set to obtain a set of response status codes.

[0052] In an embodiment of the present invention, concurrent HTTP requests are initiated for all the collected resource links. Multiple concurrent sessions can be created through an asynchronous IO framework (such as aiohttp), send GET requests for each link, and capture the response status codes (such as HTTP 200 indicates success, 404 indicates that the resource does not exist). For links that require authentication (such as VIP content), the Cookie token after platform login is automatically injected into the request header to simulate accessing restricted resources as a legitimate user.

[0053] Step S104, assign a validity status identifier to each resource link according to the set of response status codes to obtain an identifier set, and the identifier set includes valid identifiers and / or invalid identifiers.

[0054] In an embodiment of the present invention, according to the set of status codes, a validity identifier is assigned to each resource link. If the status code belongs to a preset valid range (such as 200 - 299), it is marked as "valid"; otherwise, it is marked as "invalid". After the identification result is associated with the original link and platform information, it is stored in the file system (for example, generating a CSV file), and the alarm module is triggered to notify the invalid links (for example, sending an email to remind the operation and maintenance team). Thus, a single - time automated verification loop for all - platform resources is completed.

[0055] Optionally, periodically traverse multiple resource pages of multiple multimedia platforms. Specifically, a timed task scheduling framework is built through Jenkins to periodically execute the above - mentioned process (for example, once an hour) to achieve active monitoring of protocol changes. This process converts the lag of traditional manual inspections (relying on user feedback) into automated real - time detection, and can complete full - platform coverage within a preset period after the protocol is updated, which can shorten the fault - repair response time and significantly reduce the probability of users perceiving faults.

[0056] The beneficial effects of the embodiments of the present invention compared with the prior art are as follows: By simulating real - user behavior to traverse heterogeneous platforms and dynamically obtaining multimedia URLs under the latest protocol, it overcomes the adaptability defects of fixed parsing mechanisms to protocol changes; Through asynchronous concurrent technology, batch status detection of a large number of links and instant determination of response status codes are realized, which can significantly improve the efficiency of validity verification, and can move the problem - discovery node from user - side complaints to active monitoring on the development side, realizing timely monitoring of the validity of multimedia resources.

[0057] In traditional technologies, testers need to manually collect multimedia URLs of each platform and rely on manual recording of link status (such as whether it is valid, whether login is required). Manual maintenance cannot timely perceive protocol changes or link expiration, and there are often situations where the link has expired when users access it; The lack of systematic management of link metadata (such as expiration time, authentication requirements) leads to a high failure rate of user downloads and time - consuming fault troubleshooting. Based on this, an optional embodiment of the present invention is proposed.

[0058] After step S103, the following specific implementation manners are further included.

[0059] Step S201, generate a resource list according to the identification set. The resource list includes valid download links determined in the resource link set and status information of the valid download links. The status information includes expiration time and / or whether authentication is required.

[0060] In an embodiment of the present invention, after the allocation of resource link validity identifiers is completed, the identifier set is traversed to filter out all download links marked as "valid". For each valid link, the expiration time is extracted by parsing its corresponding HTTP response header information (such as the Expires field), and at the same time, it is determined whether the link requires login authentication according to whether authentication credentials (such as cookie tokens) are injected during the request process. For example, for a VIP resource link, if the Authentication-Required: true field is carried in its response header, it is marked as "requiring authentication".

[0061] The valid links and their associated status information (including expiration time, authentication requirements, resolution, audio quality, etc.) are integrated into structured data according to a preset template. For example, the metadata of each link is stored in a Python dictionary, and a JSON-format resource list file is generated through the json.dump method. This list is indexed by the platform name and resource type (such as movies, music), supporting fast query and priority sorting (such as preferentially displaying high-resolution links).

[0062] The generated resource list is stored in a database or a distributed file system (such as HDFS), and a timestamp is recorded to distinguish the detection results of different cycles. Each time the verification process is executed, the system compares the new and old resource lists, automatically eliminates expired links (such as those with an expiration time earlier than the current timestamp), and at the same time adds new valid links to ensure the timeliness and accuracy of the resource list.

[0063] In the embodiment of the present invention, by automatically generating a dynamically updated resource list and attaching key metadata such as expiration time and authentication status, the problems of low efficiency and information lag in manually maintaining download links in the traditional technology are solved.

[0064] In the traditional technology, testers need to manually visit each platform page and click on the classification labels one by one to obtain the URLs. Manual operations cannot cover all platforms and resource types (such as VIP zones, hidden pages), resulting in a test case coverage rate of less than 60%; manually copying and pasting URLs is likely to introduce format errors, resulting in a relatively high subsequent parsing failure rate; in the face of an increase in the number of platforms, the manual collection time grows linearly, making it difficult to support large-scale detection requirements. Based on this, an alternative embodiment of the present invention is proposed.

[0065] Refer to Figure 2 , Figure 2 which is a schematic diagram of a specific embodiment of step S102 of the method for validating the effectiveness of multimedia resources in the embodiment of the present invention. Step S102 further includes the following specific embodiments.

[0066] Step S1021, perform resource link collection operations on multiple multimedia platforms in a distributed manner to obtain multimedia information. The distributed operations are implemented through the asyncio module and the concurrent.futures module.

[0067] In an embodiment of the present invention, initialize the distributed collection framework, manage asynchronous tasks through the asyncio event loop, and divide multiple multimedia platforms into independent subtasks through the concurrent.futures thread pool. For example, group more than 40 platforms by resource type (such as video, audio, live broadcast), and allocate each group to an independent thread for execution to avoid inefficiency caused by single-thread blocking.

[0068] In each subtask, instantiate multiple virtual users by calling the Playwright headless browser, and simulate clicking on different resource classification pages of the target platform (such as the "latest" and "popular" tags under the movie classification). After triggering page jumps through page.click(), use the query_selector_all() method to traverse the DOM tree and locate specific elements containing multimedia URLs (such as <a class="download-link">) Extract the set of original links.

[0069] Step S1022: Store the multimedia information in a dictionary structure and write it to an intermediate file in YAML format through the yaml.dump method to obtain a set of resource links.

[0070] In an embodiment of the present invention, regular matching is performed on the extracted original links to remove redundant parameters. The cleaned links are organized into a nested dictionary structure according to dimensions such as platform name, resource type, and collection timestamp.

[0071] Write the multimedia information in dictionary structure to an intermediate file (File A) in YAML format through the yaml.dump() method. This file is stored in a key-value pair format with strong readability.

[0072] In an embodiment of the present invention, through the distributed asynchronous acquisition and structured storage technology, the efficiency and reliability of obtaining multimedia links are significantly improved. Specifically, through the cooperative concurrency mechanism of asyncio and concurrent.futures, the resource acquisition time is significantly shortened compared with the traditional single-threaded method; based on the standardized storage of the YAML intermediate file, format errors during manual data collation are avoided, and the link missing acquisition rate is reduced; 3) the distributed architecture supports dynamic expansion, and when adding a new platform, only a subtask needs to be added for seamless integration, reducing the time-consuming for platform compatibility expansion.

[0073] In the traditional technology, testers need to manually distinguish between authenticated and unauthenticated links and temporarily obtain cookies during verification (such as copying and pasting when logging in to the platform). Manually maintaining cookies is prone to expiration or omission, resulting in a high failure rate of VIP resource verification. Based on this, the present invention proposes an optional embodiment.

[0074] Refer to Figure 3 , Figure 3 FIG. is a schematic diagram of a specific embodiment of step S103 of the multimedia resource validity verification method in an embodiment of the present invention. Step S103 further includes the following specific embodiments.

[0075] Step S1031, split the resource link set into a first link set and a second link set. Each first resource link in the first link set corresponds to a first multimedia platform that requires login authentication, and each second resource link in the second link set corresponds to a second multimedia platform that does not require login authentication.

[0076] In an embodiment of the present invention, based on a platform preset rule library (such as a platform whitelist, authentication API features), dynamically split the resource link set into two categories: a first link set that requires login authentication (such as VIP video, paid music links) and a second link set that does not require authentication (such as free public resources). The / vip / or / premium / fields in the URL path can be matched through regular expressions to determine that the link belongs to the first category. At the same time, combined with the authentication failure records recorded in the historical access logs, dynamically update the classification rules to ensure classification accuracy when the platform protocol changes.

[0077] Step S1032, send a first HTTP request to each first resource link and a second HTTP request to each second resource link to obtain a set of response status codes. The request header of the first HTTP request is injected with the cookie verification token corresponding to the access target in the first multimedia platform.

[0078] In an embodiment of the present invention, for each resource link in the first link set, a pre-stored authentication credential library (such as an OAuth 2.0 token, a platform cookie) is called, and a persistent connection is established through the Session object of the requests library. Before sending the first HTTP request, the cookie authentication token corresponding to the platform is automatically injected into the request header (for example, adding the field Cookie: session_id = xxxx). For example, for the VIP resources of platform A, the latest cookie value is extracted from the encrypted storage credential management system and appended to the Authorization field of the request header.

[0079] An HTTP GET request with an authentication token is initiated for the first link set, and a standard HTTP GET request is initiated for the second link set. The parallel sending of the two types of requests is achieved through an asynchronous IO framework (such as aiohttp), and at the same time, a timeout threshold (such as 5 seconds) and a retry mechanism (such as 3 retries) are set. The response status code is captured in real time (for example, 200 is valid, 401 is authentication failure, 404 is resource not found), and the metadata in the response body is recorded. For the authentication request, the X-Auth-Status field in the response header is additionally verified. If expired is returned, the token refresh process is triggered.

[0080] The response status codes of the two types of requests are combined into a global status code set, and at the same time, the source type (authentication / non-authentication) of each status code is marked. For the 401 / 403 status codes that appear in the authentication requests, an alarm notification is triggered to prompt the developer to check the token validity or platform protocol changes; for the 404 / 500 status codes of the non-authentication requests, they are directly marked as invalid links.

[0081] In the embodiment of the present invention, by differentiating the authentication and non-authentication resource links and dynamically injecting the latest credentials, the accuracy of validity verification and the protocol adaptability are significantly improved. Efficient and accurate verification in complex authentication scenarios is achieved.

[0082] In the traditional technology, developers need to manually check the response status code of each link and rely on experience to judge its validity. The manual processing speed is slow and cannot meet the detection requirements of tens of thousands of links per day. Based on this, an alternative embodiment of the present invention is proposed.

[0083] Refer to Figure 4 , Figure 4 which is a schematic diagram of a specific embodiment of step S104 of the method for validating the effectiveness of multimedia resources in the embodiment of the present invention. Step S104 further includes the following specific embodiments.

[0084] Step S1041: Split the resource link set into a valid link set and an invalid link set according to the valid status codes and invalid status codes in the response status code set.

[0085] In an embodiment of the present invention, traverse the global response status code set, and preliminarily classify each resource link according to a preset rule (for example, HTTP 200 - 299 is valid, 400 - 599 is invalid). For example, mark the link with a status code of 200 as "valid", and mark the link with a status code of 404 / 500 as "invalid". At the same time, for the custom status codes of the multimedia platform (such as a certain platform uses code = 0 to represent success), call the platform adapter module for semantic mapping to ensure that the classification rules are consistent with the platform protocols.

[0086] Based on the classification results, use the set operation of Python to split the resource link set into two independent subsets: a valid link set (storing all validly identified links) and an invalid link set (storing all invalidly identified links).

[0087] Step S1042: Assign valid identifiers to the valid link set and invalid identifiers to the invalid link set to obtain an identifier set.

[0088] In an embodiment of the present invention, assign a "valid" identifier to each URL in the valid link set and associate its metadata; assign an "invalid" identifier to the invalid link set and record the reason for failure (for example, "404 - Resource not found"). The identification information is embedded in the metadata field of the resource link in the form of key - value pairs.

[0089] Write the valid and invalid link sets into different files respectively, and manage the historical records through a version control system (such as Git). Each split operation generates a unique version number, which is convenient for tracing the link status at a specific time point and assisting in analyzing the impact range of platform protocol changes.

[0090] In an embodiment of the present invention, through the automated status code classification and dynamic set splitting mechanism, the problems of inefficiency and misjudgment in link validity determination in the traditional technology are solved. Specifically, the fast classification based on the rule engine can reduce the verification time of a large number of links from several days of manual processing to the minute level.

[0091] In the traditional technology, the validity verification only depends on the HTTP status code or the platform return code, which has serious defects. Some platforms return a 200 status code but the actual content has expired, resulting in a large number of "false valid" links being misjudged; the resource content may be maliciously tampered with while the URL remains unchanged, and the traditional method cannot identify it; the efficiency of manual sampling for content compliance is low and it is difficult to handle a large number of resources. Based on this, an alternative embodiment of the present invention is proposed.

[0092] Step S1041 also includes the following specific implementation methods.

[0093] Step S10411 : Split the resource link set into a third link set according to the valid status codes in the response status code set, and split the resource link set into a fourth link set according to the invalid status codes in the response status code set.

[0094] In this embodiment of the present invention, response status codes are classified according to preset rules. Resource links that meet valid status code standards (such as HTTP 200 or platform-defined success codes) are grouped into the third link set (the initial valid set), and the rest are grouped into the fourth link set (the initial invalid set). This step relies solely on the protocol layer status information for preliminary screening.

[0095] A second request is made to each resource in the third link set to obtain the resource content fragment (such as file header data). Detecting anomalies may include:

[0096] Tamper detection: calculate the hash value of the resource content and compare it with the standard hash value officially released by the platform. If they are inconsistent, it is determined that the content has been tampered with.

[0097] Integrity verification: parsing the file header structure (such as the format identifier of video files and the metadata of audio files) to determine whether the resources are complete and available.

[0098] Screening of sensitive content: calling content security models (such as natural language processing and image recognition) to analyze resource descriptions or preview content to identify whether there is any illegal information.

[0099] Step S10412: If there is an abnormal link in the third link set, the abnormal link is moved to the fourth link set to obtain a valid link set and an invalid link set respectively. The valid link set is the updated third link set, and the invalid link set is the updated fourth link set. The resource data corresponding to the abnormal link is determined to be abnormal.

[0100] In this embodiment of the present invention, if abnormal data (such as hash mismatch, file header corruption, or sensitive content) is found in the third link set, the corresponding link is marked as abnormal and migrated to the fourth link set. After migration, the third set is updated to the final valid set, and the fourth set integrates the combined invalid results of invalid protocol and abnormal content.

[0101] In the embodiments of the present invention, through a dual verification mechanism of status code and content detection, the problem of "false validity" caused by relying solely on the protocol layer status code in the traditional technology is solved. Content-level detection results in a low misjudgment rate of valid links and a reduced user download failure rate; the hash comparison technology can identify silent tampering of resources, effectively preventing users from obtaining unexpected content; sensitive content screening can help intercept illegal resources in advance, reducing the content security risk of the platform.

[0102] In traditional technology, validity verification only relies on the HTTP status code or the platform return code, which has serious defects. Some platforms return a 200 status code but the actual content has expired, resulting in a large number of "false valid" links being misjudged; the resource content may be maliciously tampered with while the URL remains unchanged, and traditional methods cannot identify it; the efficiency of manually sampling content compliance is low and it is difficult to handle a large number of resources. Based on this, the present invention proposes an optional embodiment.

[0103] Step S101 further includes the following specific embodiments.

[0104] Step S1011, split out the third link set from the resource link set according to the valid status codes in the response status code set, and split out the fourth link set from the resource link set according to the invalid status codes in the response status code set.

[0105] In the embodiments of the present invention, the response status codes are classified according to preset rules, and the resource links that meet the valid status code criteria (such as HTTP 200 or the success code defined by the platform) are classified into the third link set (initial valid set), and the rest are classified into the fourth link set (initial invalid set). This step only relies on the protocol layer status information for preliminary screening.

[0106] Initiate a secondary request for each resource in the third link set to obtain a resource content fragment (such as file header data).

[0107] Optionally, detect whether there is abnormal data in the resource set corresponding to the third link set. The abnormal data includes tampered data, incomplete data, and / or sensitive data. Specifically, tampering detection can be performed by calculating the hash value of the resource content and comparing it with the standard hash value released by the platform official. If they are inconsistent, it is determined that the content has been tampered with. Integrity verification can be performed by parsing the file header structure (such as the format identifier of a video file, the metadata of an audio file) to determine whether the resource is complete and available. Sensitive content screening can be performed by calling a content security model (such as natural language processing, image recognition) to analyze the resource description or preview content to identify whether there is any illegal information.

[0108] Step S1011, if there are abnormal links in the third link set, move the abnormal links to the fourth link set to obtain an effective link set and an invalid link set respectively. The effective link set is the updated third link set, and the invalid link set is the updated fourth link set. The resource data corresponding to the abnormal links is determined to be abnormal.

[0109] In an embodiment of the present invention, if abnormal data (such as hash mismatch, file header corruption, or sensitive content) is found in the third link set, the corresponding link is marked as abnormal and migrated to the fourth link set. After migration, the third set is updated to the final effective set, and the fourth set integrates the comprehensive invalid results of protocol invalidity and content abnormality.

[0110] In an embodiment of the present invention, through a dual verification mechanism of status code and content detection, the "false valid" problem caused by only relying on the protocol layer status code in the traditional technology is solved. Content-level detection results in a low misjudgment rate of valid links and a reduced user download failure rate. Further, the hash comparison technology can identify silent tampering of resources, effectively avoiding users from obtaining unexpected content; the sensitive content screening can help intercept illegal resources in advance, reducing the content security risk of the platform.

[0111] As Figure 5 shown, it is a schematic diagram of a terminal device provided by an embodiment of the present invention. The terminal device 5 may include: a processor 501, a memory 502, and a computer program 503 stored in the memory 502 and executable on the processor 501, such as a validity verification program for multimedia resources. When the processor 501 executes the computer program 503, the steps in the above-mentioned validity verification embodiments of each multimedia resource are implemented.

[0112] The computer program can be divided into one or more modules / units. One or more modules / units are stored in the memory 502 and executed by the processor 501 to complete the present invention. One or more modules / units may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program in the terminal device.

[0113] The terminal device may include, but is not limited to, a processor 501 and a memory 502. Those skilled in the art can understand that Figure 5 merely an example of the terminal device, which does not constitute a limitation on the terminal device. It may include more or fewer components than shown in the figure, or combine certain components, or different components. For example, the terminal device may further include input / output devices, network access devices, a bus, etc.

[0114] The so-called processor 501 may be a Central Processing Unit (CPU), or may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0115] The memory 502 may be an internal storage unit of the terminal device, such as the hard disk or memory of the terminal device. The memory 502 may also be an external storage device of the terminal device, such as a plug-in hard disk equipped on the terminal device, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. Further, the memory 502 may also include both the internal storage unit and the external storage device of the terminal device. The memory 502 is used to store computer programs and other programs and data required by the terminal device. The memory 502 may also be used to temporarily store data that has been output or is to be output.

[0116] It should be noted that for the convenience and brevity of description, the structure of the above terminal device may also refer to the specific description of the structure in the method embodiments, which will not be elaborated here.

[0117] The embodiment of the present invention also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above method for validating the effectiveness of multimedia resources can be implemented.

[0118] The embodiment of the present invention provides a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal can be made to execute the steps in the above method for validating the effectiveness of multimedia resources.

[0119] In the above embodiments, the descriptions of the respective embodiments have their own focuses. For parts not elaborated or recorded in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.

[0120] Those of ordinary skill in the art will appreciate that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or in a combination of computer software and electronic hardware. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods for each specific application to implement the described functions, but such implementation should not be considered to exceed the scope of the present invention.

[0121] In the embodiments provided by the present invention, it should be understood that the disclosed terminal devices and methods can be implemented in other ways. For example, the terminal device embodiments described above are merely illustrative. Additionally, the couplings or direct couplings or communication connections shown or discussed among each other can be through some interfaces, and the indirect couplings or communication connections of devices or units can be in electrical, mechanical, or other forms.

[0122] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they can be located in one place, or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0123] In addition, the functional units in each embodiment of the present invention can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

[0124] When the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, to implement all or part of the processes in the above-mentioned embodiment methods of the present invention, it can also be completed by a computer program instructing relevant hardware. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disc, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the content included in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electrical carrier signals and telecommunication signals.

[0125] The above-mentioned embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features. These modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. A method for validating the effectiveness of multimedia resources, characterized in that, Including: Traverse multiple resource pages of multiple multimedia platforms, and the traversal operation is implemented by simulating browser click operations; Collect the resource link sets corresponding to the multiple resource pages; Access each resource link in the resource link set to obtain a response status code set; According to the response status code set, assign a validity status identifier to each resource link to obtain an identifier set, and the identifier set includes valid identifiers and / or invalid identifiers.

2. The method for validating the effectiveness of multimedia resources according to claim 1, characterized in that, After the step of assigning a validity status identifier to each resource link according to the response status code set to obtain an identifier set, the method further includes: Generate a resource list according to the identifier set, where the resource list contains valid download links determined in the resource link set and status information of the valid download links, and the status information includes expiration time and / or whether authentication is required.

3. The method for validating the effectiveness of multimedia resources according to claim 1, wherein The step of collecting the resource link sets corresponding to the multiple resource pages includes: Distributively perform resource link collection operations on the multiple multimedia platforms to obtain multimedia information, and the distributive operation is implemented by the asyncio module and the concurrent.futures module; Store the multimedia information in a dictionary structure and write it into an intermediate file in YAML format through the yaml.dump method to obtain the resource link set.

4. The method for validating the effectiveness of multimedia resources according to claim 1, wherein The step of accessing each resource link in the resource link set to obtain a response status code set includes: Split the resource link set into a first link set and a second link set, where each first resource link in the first link set corresponds to a first multimedia platform that requires login authentication, and each second resource link in the second link set corresponds to a second multimedia platform that does not require login authentication; Send a first HTTP request to each of the first resource links and send a second HTTP request to each of the second resource links to obtain the response status code set, and the request header of the first HTTP request is injected with the cookie verification token corresponding to the access target in the first multimedia platform.

5. The method for validating the effectiveness of multimedia resources according to claim 1, characterized in that, The step of assigning a validity status identifier to each resource link according to the response status code set to obtain an identifier set includes: According to the valid status codes and invalid status codes in the response status code set, split the resource link set into a valid link set and an invalid link set; Assign the valid identifier to the valid link set and assign the invalid identifier to the invalid link set to obtain the identifier set.

6. The method for validating the effectiveness of a multimedia resource according to claim 5, wherein The step of splitting the resource link set into a valid link set and an invalid link set according to the valid status codes and invalid status codes in the response status code set includes: Split out a third link set from the resource link set according to the valid status codes in the response status code set, and split out a fourth link set from the resource link set according to the invalid status codes in the response status code set; If there are abnormal links in the third link set, move the abnormal links into the fourth link set to obtain the valid link set and the invalid link set respectively. The valid link set is the updated third link set, and the invalid link set is the updated fourth link set. The resource data corresponding to the abnormal links is determined to be abnormal.

7. The method for validating the effectiveness of a multimedia resource according to claim 6, characterized in that, Before the step of moving the abnormal links into the fourth link set if there are abnormal links in the third link set to obtain the valid link set and the invalid link set respectively, the method further includes: Detect whether there is abnormal data in the resource set corresponding to the third link set. The abnormal data includes tampered data, incomplete data, and / or sensitive data; If there is the abnormal data, determine the link corresponding to the abnormal data as the abnormal link.

8. The method for validating the effectiveness of multimedia resources according to claim 1, characterized in that, The step of traversing multiple resource pages of multiple multimedia platforms further includes: Periodically traverse multiple resource pages of multiple multimedia platforms.

9. A terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the method for validating the effectiveness of multimedia resources according to any one of claims 1 to 8.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the method for validating the effectiveness of multimedia resources according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Website safety protection and test diagnosis system structure method based on crawler technology

    CN101510195A

  • URL link validity verification method

    CN105975526A

  • URL management method and system

    CN107526833A

  • Page detection method and device, electronic equipment and storage medium

    CN116991704A

  • Link Information Inspection System

    JP7349098B1