JavaScript Template Segmentation for Random Ad Filtering
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing advertisement filtering technologies, such as network interception and element hiding, are ineffective against random-feature advertisements on webpages, especially on mobile terminals, and JavaScript-based solutions consume excessive network flow and pose security risks.
Innovation Solution
A method involving a terminal and a backend server that uses a JavaScript template with filtering parameters to identify and block random-feature advertisements, optimizing network usage by separating template and parameter updates and enhancing security through parameter checking.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If network interception is used to filter advertisements, then advertisement filtering performance is improved, but it cannot filter advertisements with random features
Solution Approach 1:
The patent segments the advertisement filtering mechanism into two independent parts: a JS template (structure) and filtering parameters (data). The template contains the logic for identifying and filtering advertisements, while parameters store the specific advertisement identifiers. This segmentation allows the filtering system to adapt to random-feature advertisements by updating parameters without changing the template structure, thereby improving both reliability and adaptability.
Solution Approach 2:
The patent uses parameter changes to adapt the filtering system to different advertisement types. By storing advertisement identifiers (URLs, keywords, tags) as configurable parameters, the system can filter advertisements with random features by simply updating the parameter values rather than modifying the core filtering logic. This resolves the contradiction by maintaining stable template structure while enabling flexible adaptation to new advertisement patterns.
2Reliability
If JavaScript is used for advertisement filtering, then filtering capability is improved, but network flow consumption increases
Solution Approach 1:
The patent segments JavaScript code into a template part (downloaded once) and a parameters part (downloaded on-demand). The template contains the filtering logic that can be cached and reused, while only the lightweight parameters need to be fetched when accessing new webpages. This significantly reduces network flow consumption compared to downloading complete JavaScript filtering solutions for every webpage.
Solution Approach 2:
The patent performs preliminary action by downloading and caching the JS template in advance. The template contains the core filtering logic that remains relatively stable across different webpages. By preparing this component beforehand, the system avoids repeated downloads of large JavaScript files, thereby reducing network flow consumption while maintaining strong filtering capability.
3Reliability
If complete JavaScript code is exposed for filtering, then filtering functionality is improved, but security risks increase
Solution Approach 1:
The patent extracts the critical filtering logic from the complete JavaScript code and places it in a protected template structure. The template contains core functions that are not directly executable without the parameters, creating a security layer. This extraction separates the immutable filtering logic from the variable parameters, reducing security risks while preserving filtering functionality.
Solution Approach 2:
The patent introduces an intermediary layer (the template structure) between the filtering logic and the parameters. The template acts as a mediator that processes parameters through controlled functions, preventing direct execution or modification of core logic. This intermediary structure mitigates security risks by limiting the exposure and direct accessibility of the complete JavaScript code.
4Adaptability or versatility
If JavaScript template with parameters is used, then adaptability to random-feature advertisements is improved, but device complexity increases
Solution Approach 1:
The patent segments the filtering system into a simple template structure and parameter data, where the template contains basic filtering logic and parameters store advertisement identifiers. This segmentation reduces device complexity by separating concerns: the template provides stable, simple logic while parameters provide flexible, data-driven adaptability. The separation makes the system easier to implement and maintain compared to a monolithic JavaScript solution.
Data Source
AI summary
An information processing method is provided. The method includes acquiring a JavaScript (JS) template for filtering multimedia information from a backend server when determining a preset update condition is satisfied; and acquiring a filtering parameter corresponding to a target webpage from the backend server when detecting that a user requests to access the target webpage. The method also includes inserting the filtering parameter into the JS template; executing the JS template inserted with the filtering parameter, screening out multimedia information from webpage information displayed on the target webpage and shielding displaying of the multimedia information.


