Bullet Comment Rendering in WeChat Mini Programs

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

The rendering of bullet comments on a WeChat mini program-based video playback page is often not smooth, and excessive computing resources are used due to the differences in framework between WeChat mini programs and conventional browsers, particularly the absence of a requestAnimationFrame API.

Innovation Solution

A method is implemented where bullet comment processing is performed at a predetermined time interval using a target function that simulates requestAnimationFrame, incorporating a timing function and callback to recursively call the rendering function, ensuring smooth rendering and proper resource usage by polling the logical layer's state to determine if processing can be performed.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If bullet comment processing is performed continuously without time interval control, then rendering smoothness is improved, but computing resource consumption increases excessively

Engineering Contradiction:
Improverendering smoothnessVSAvoidcomputing resource consumption
Core Design Contradiction:
ReliabilityVSUse of energy by moving object

Solution Approach 1:

The patent implements periodic action by introducing a predetermined time interval mechanism for bullet comment processing operations. The system polls the logical layer state at regular intervals and only processes bullet comments when the layer is in an idle state, preventing continuous processing and reducing computing resource consumption while maintaining rendering smoothness through timed updates synchronized with screen refresh rates.

Inventive Principle:
Principle #19Periodic action

2Use of energy by moving object

If bullet comment processing is performed at irregular intervals, then computing resource usage is reduced, but rendering smoothness deteriorates with frame drops

Engineering Contradiction:
Improvecomputing resource usageVSAvoidrendering smoothness
Core Design Contradiction:
Use of energy by moving objectVSReliability

Solution Approach 1:

The system employs periodic polling at predetermined time intervals to check the logical layer state, ensuring regular processing opportunities while avoiding continuous operation. This periodic mechanism synchronizes with screen refresh rates to prevent frame drops and maintain rendering smoothness.

Inventive Principle:
Principle #19Periodic action

Solution Approach 2:

The patent implements feedback by polling the logical layer state to determine whether it is in a busy or idle state before processing bullet comments. This feedback mechanism allows the system to adapt processing timing to actual system conditions, ensuring smooth rendering while optimizing resource usage by processing only when appropriate.

Inventive Principle:
Principle #23Feedback

3Adaptability or versatility

If the WeChat mini program framework is used instead of conventional browser framework, then adaptability to mobile platforms is improved, but bullet comment rendering performance worsens due to framework differences

Engineering Contradiction:
Improvemobile platform adaptabilityVSAvoidbullet comment rendering performance
Core Design Contradiction:
Adaptability or versatilityVSReliability

Solution Approach 1:

The patent introduces an intermediary mechanism in the form of a logical layer that sits between the WeChat mini program framework and the bullet comment rendering system. This logical layer provides standardized interfaces and state management, mediating the differences between the mini program framework and conventional browser frameworks while maintaining rendering performance through controlled processing intervals and state polling.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS12022150B2Bullet comment processing method and system based on WeChat mini-program
Publication Date: 2024.06.25 SHANGHAI BILIBILI TECH CO LTD
  • US12022150B2 patent drawing
  • US12022150B2 patent drawing
  • US12022150B2 patent drawing

AI summary

The present disclosure describes techniques of processing bullet comments. The techniques comprise obtaining a page of playing a video for outputting a video stream; obtaining a plurality of pieces of bullet comment data associated with the video stream; and performing a bullet comment processing operation with a predetermined time interval, where the bullet comment processing operation includes performing bullet comment processing at a logical layer on the plurality of pieces of bullet comment data. In the embodiments of the present application, a balanced time interval may be set as the predetermined time interval to regularly perform a bullet comment processing operation, so that smoothness of displaying bullet comments and proper use of computing resources are ensured.