Bullet Comment Processing in WeChat Mini Programs
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Unpredictable bugs often occur during the display of bullet comments in WeChat mini programs due to asynchrony between the render layer and the logical layer, affecting user experience.
Innovation Solution
A method is implemented to simulate a single-thread block mechanism by adjusting operation indication information to prevent subsequent operations until previous bullet comment processing operations are completed, ensuring each operation finishes before the next begins, thereby avoiding bugs caused by asynchronous communication between the render and logical layers.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If asynchronous communication between render layer and logical layer is used in WeChat mini program, then development flexibility and layer independence are improved, but unpredictable bugs occur during bullet comment display
Solution Approach 1:
The patent introduces an operation indication information mechanism as an intermediary between the logical layer and render layer. This mediator controls the execution flow by setting operation indications (first indication for blocking, second indication for allowing) to ensure that render operations complete before logical layer operations proceed, thus preventing asynchronous bugs while maintaining layer independence
Solution Approach 2:
The patent performs preliminary actions by adjusting operation indication information to the first indication before executing bullet comment processing operations. This preliminary blocking ensures that subsequent operations wait for previous operations to complete, preventing race conditions and display bugs before they can occur
2Reliability
If sequential bullet comment processing operations are implemented to ensure completion, then display stability is improved, but processing time increases
Solution Approach 1:
The patent implements periodic action by using operation indication information that can be adjusted between first indication (blocking) and second indication (allowing). This periodic switching creates a controlled execution rhythm where operations proceed in batches rather than strictly sequentially, reducing total processing time while ensuring completion
Data Source
AI summary
The present disclosure describes techniques of processing bullet comments. The techniques comprise obtaining a page of playing a video to output a video stream; obtaining a plurality of pieces of bullet comment data associated with the video stream; and performing an ith bullet comment processing operation comprising adjusting operation indication information to a first piece of indication information; traversing the plurality of pieces of bullet comment data and determining whether the plurality of bullet comment data comprise a piece of bullet comment data in a to-be-posted state; performing a processing operation on the piece of bullet comment data in the to-be-posted state; in response to determining that the processing operation on the piece of bullet comment data in the to-be-posted state has been completed, adjusting the operation indication information to a second piece of indication information. In the present application, the operation indication information is configured to perform or block an operation subsequent to a bullet comment processing operation.


