Message Delay Detection in Android Threads
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing delay detection mechanisms, such as those in Android systems, provide inaccurate delay reports, affecting system performance and user experience due to insufficient accuracy in identifying message delays within application threads.
Innovation Solution
A method and apparatus for detecting message delay that involves obtaining processing time periods for messages in target threads, recognizing message types, determining message-specific delay thresholds, and performing delay detection based on these thresholds to improve accuracy and granularity of delay detection.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If a native delay detection mechanism is used to detect message delay, then delay detection is provided, but the detection accuracy is insufficient
Solution Approach 1:
The patent segments the delay detection process by dividing messages into different types (e.g., UI messages, background messages) and applying different delay thresholds to each type. This segmentation allows for more accurate detection by evaluating each message type against its specific threshold rather than using a single generic threshold, thereby resolving the contradiction between detection accuracy and mechanism complexity.
Solution Approach 2:
The patent implements local quality by setting different delay thresholds for different message types based on their specific requirements. For example, UI messages may have stricter thresholds than background messages. This localized approach improves detection accuracy for each message type while maintaining a manageable level of overall system complexity through structured categorization.
2Measurement precision
If a single delay threshold is used for all message types, then the detection mechanism is simple, but the detection result is inaccurate
Solution Approach 1:
The patent changes the parameter of delay thresholds from a single uniform value to multiple differentiated values based on message types. This parameter change enables more accurate detection by matching thresholds to the specific characteristics of different message types, while the complexity is managed through systematic classification and configuration of threshold parameters.
3Measurement precision
If delay detection is performed at the thread level, then overall system delay is detected, but message-specific delay localization is coarse
Solution Approach 1:
The patent segments delay detection from the thread level to the individual message level. By detecting delay for each message separately and categorizing by message type, the system achieves fine-grained delay localization. This segmentation resolves the contradiction by enabling precise identification of which specific messages are delayed while maintaining structured management through message type classification.
Data Source
AI summary
An embodiment of the present application discloses a method and an apparatus of detecting message delay, an electronic device, and a storage medium. The method includes: obtaining a processing time period corresponding to a message in the target thread when a target thread of an application program is executed in a terminal system; performing type recognition on the message in the target thread to obtain a message type of the message; determining a message delay threshold corresponding to the message based on the message type; performing delay detection on the message based on the processing time period and the message delay threshold to obtain a delay detection result of the message.


