A method for processing screen projection crash and related equipment
By receiving test feedback, capturing log information, and optimizing task priorities, the kernel crash issue caused by pressing the exit button after screen mirroring was resolved, enabling reliable task execution under high CPU utilization and improving system stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN COOCAA NETWORK TECH CO LTD
- Filing Date
- 2023-06-08
- Publication Date
- 2026-08-04
AI Technical Summary
The existing technology addresses the issue of kernel crashes caused by pressing the exit button after screen mirroring, where the cause cannot be located.
By receiving test feedback and capturing log information, we search for processing tasks in the kernel based on the log information, directly print the problematic function in the function embedded by the main IC chip manufacturer, search for tasks in the driver, determine the root cause of the kernel crash based on the pointer assignment when exiting screen projection, and optimize the priority of tasks to ensure that tasks can still be executed when the CPU utilization is high.
It effectively solved the kernel crash problem caused by pressing the exit button after screen mirroring. By using modular analysis to locate the root cause, it ensured that the task could be executed even under high CPU usage, thus improving system stability.
Smart Images

Figure CN116820817B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication technology, and in particular to a method, system, terminal, and computer-readable storage medium for handling screen mirroring crashes. Background Technology
[0002] Currently, there are various screen mirroring methods available for sharing between large and small screens, such as screen mirroring and DLNA (Digital Living Network Alliance). DLNA screen projection allows video content linked from a mobile phone to be projected onto a TV, where the TV can not only display content but also perform other operations. After screen projection, the mobile phone can perform other operations without remaining on the projected screen. However, in actual use, screen mirroring encounters several problems, primarily including the need to consume significant network bandwidth, leading to audio and video playback stuttering. Another issue is the kernel crash that occurs when the exit button is pressed after screen mirroring (a kernel crash occurs when the operating system kernel encounters an unhandled error or exception and stops working; when a kernel crash occurs, the computer cannot continue to operate normally, usually displaying a blue screen or black screen, or directly restarting).
[0003] Therefore, existing technologies still need to be improved and developed. Summary of the Invention
[0004] The main objective of this invention is to provide a method, system, terminal, and computer-readable storage medium for handling screen mirroring crashes, aiming to solve the problem in the prior art where the cause of a kernel crash cannot be located when the exit button is pressed after screen mirroring.
[0005] To achieve the above objectives, the present invention provides a method for handling screen mirroring crashes, the method comprising the following steps:
[0006] Receive test feedback; if a kernel crash occurs after pressing the exit button after screen mirroring, capture the log information.
[0007] Based on the log information, the kernel is searched for processing tasks, and the problematic function is directly printed out from the function embedded by the main IC chip manufacturer.
[0008] Search for tasks in the driver and determine the root cause of the kernel crash based on the pointer assignment when exiting screen mirroring.
[0009] Optionally, in the method for handling screen mirroring crashes, the test feedback refers to problems discovered by testers during the testing process.
[0010] Optionally, in the method for handling screen mirroring crashes, the log information includes on-site information when the problem occurred, and the possible causes of the kernel crash are queried through the on-site information.
[0011] Optionally, in the screen mirroring crash handling method, the driver is used to place processing tasks into a queue, and when an interrupt occurs, the CPU retrieves the task from the queue and processes it.
[0012] Optionally, in the screen mirroring crash handling method, all tasks are decomposed into individual work items in the Wi-Fi driver and scheduled to the work queue by the CPU, so that the CPU can execute the relevant tasks.
[0013] Optionally, the method for handling screen mirroring crashes is categorized according to the importance and priority of the tasks:
[0014] Important tasks that need to be executed immediately can be executed synchronously using tasklets.
[0015] Tasks of secondary importance do not need to be executed immediately. They are scheduled by threads on each CPU, added to the corresponding work queue, and then scheduled for execution when the CPU is idle.
[0016] For unimportant tasks, a timer can be set to execute them when the time is up.
[0017] Optionally, in the method for handling screen mirroring crashes, if the priority level of the corresponding task is set to a low level, the probability of the task being executed is low. Even if the CPU is idle, the task may not be executed. By modifying the priority of the task, it is ensured that the corresponding task will be executed immediately as long as the CPU has idle time.
[0018] Furthermore, to achieve the above objectives, the present invention also provides a screen mirroring crash handling system, wherein the screen mirroring crash handling system includes:
[0019] The information acquisition module is used to receive test feedback. If a kernel crash occurs after pressing the exit button after screen mirroring, the module will capture log information.
[0020] The function printing module is used to search for processing tasks from the kernel based on the log information and directly print out the problematic function from the functions embedded by the main IC chip manufacturer.
[0021] The cause localization module is used to search within the driver and determine the root cause of the problem based on the pointer assignment when exiting screen mirroring.
[0022] In addition, to achieve the above objectives, the present invention also provides a terminal, wherein the terminal includes: a memory, a processor, and a screen mirroring crash handling program stored in the memory and executable on the processor, wherein when the screen mirroring crash handling program is executed by the processor, it implements the steps of the screen mirroring crash handling method as described above.
[0023] In addition, to achieve the above objectives, the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a screen mirroring crash handling program, and when the screen mirroring crash handling program is executed by a processor, it implements the steps of the screen mirroring crash handling method described above.
[0024] In this invention, test feedback is received. If a kernel crash occurs after pressing the exit button following screen mirroring, log information is captured. Based on the log information, processing tasks are searched within the kernel, and the problematic function is directly printed from the function embedded by the main IC chip manufacturer. The driver is also searched for tasks, and the root cause of the kernel crash is determined based on the pointer assignment when exiting screen mirroring. This invention solves the problem of being unable to pinpoint the cause of a kernel crash caused by pressing the exit button after screen mirroring in actual use. From the perspective of the actual user, a series of analyses and summaries are used to derive the cause of the problem, and then modular analysis is used to locate the corresponding module, thereby finding the root cause of the problem. Attached Figure Description
[0025] Figure 1 This is a flowchart of a preferred embodiment of the screen mirroring crash handling method of the present invention;
[0026] Figure 2 This is a schematic diagram of the log information captured on-site after pressing the exit button following screen mirroring in a preferred embodiment of the screen mirroring crash handling method of the present invention.
[0027] Figure 3 This is a schematic diagram of the principle of workqueue in a preferred embodiment of the screen mirroring crash handling method of the present invention;
[0028] Figure 4 This is a schematic diagram showing the relationship between each work_struct in a preferred embodiment of the screen mirroring crash handling method of the present invention;
[0029] Figure 5 This is a schematic diagram illustrating the execution process of different types of tasks in a preferred embodiment of the screen mirroring crash handling method of the present invention;
[0030] Figure 6 This is a schematic diagram illustrating task execution based on task priority in a preferred embodiment of the screen mirroring crash handling method of the present invention;
[0031] Figure 7This is a schematic diagram showing the destruction of the work queue after it has finished executing in a preferred embodiment of the screen mirroring crash handling method of the present invention;
[0032] Figure 8 This is a schematic diagram of a preferred embodiment of the screen mirroring crash handling system of the present invention;
[0033] Figure 9 This is a schematic diagram of the operating environment of a preferred embodiment of the terminal of the present invention. Detailed Implementation
[0034] To make the objectives, technical solutions, and advantages of this invention clearer and more explicit, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0035] The preferred embodiment of the screen mirroring crash handling method of the present invention, such as... Figure 1 As shown, the method for handling screen mirroring crashes includes the following steps:
[0036] Step S10: Receive test feedback. If a kernel crash occurs after pressing the exit button after screen mirroring, capture the log information.
[0037] Step S20: Search for processing tasks in the kernel based on the log information, and directly print out the problematic function in the function embedded by the main IC chip manufacturer;
[0038] Step S30: Search for tasks in the driver and determine the root cause of the kernel crash problem based on the pointer assignment when exiting screen mirroring.
[0039] Specifically, we received feedback from the testers that a problem they discovered during testing occurred when pressing the exit button after screen mirroring caused a kernel crash. The log information captured on-site included... Figure 2 As shown, the log mainly contains on-site information when the problem occurred. Through this information, possible causes can be found. For example, in the case of the null pointer problem below, a corresponding function was added to the code, which can print out the file and function name where the problem occurred.
[0040] Depend on Figure 2 The printed information provided searches the kernel for `process_one_work` (which handles a task; the driver is responsible for placing tasks in a queue, and when an interrupt occurs, the CPU retrieves the tasks from the queue and processes them one by one). It also directly prints the problematic function from the functions embedded by Amlogic (the main IC chip manufacturer), for example, through... Figure 2 As can be seen from the content, this corresponds to the code, where the printout in the code is the file and function name when the problem occurred.
[0041]
[0042] Search for "ieee80211_reconfig_filter" in the driver; the driver is a package of code, and this function may be called multiple times, so you need to find all the parts that are called, and then investigate the cause of the problem.
[0043] ATBM_INIT_WORK(&sdata->reconfig_filter,ieee80211_reconfig_filter); / / This was not executed, resulting in a null pointer exception.
[0044] By reading the driver's code, it was found that the driver uses a workqueue and tasklet approach. Therefore, it's necessary to first explain what a workqueue is, how tasks are scheduled and executed, and how completed tasks are deleted. Figure 3 As shown, this mainly explains the principle of workqueues. Here's how workqueues work: if the system has four cores, each CPU has a workqueue, defined as `cpu_workqueue_struct`, the work queue is defined as `Workqueue_struct`, and each corresponding job is defined as `work_struct`. The relationship between the three is as follows: Figure 4 As shown.
[0045] In the Wi-Fi driver, all tasks are broken down into individual work tasks, which are then scheduled to the work queue by the CPU at appropriate times. The CPU then executes the relevant tasks, which are mainly divided into the following categories based on their importance and priority:
[0046] 1. Important tasks that need to be executed immediately should be executed synchronously using tasklet.
[0047] 2: Tasks with lower importance do not need to be executed immediately. They are scheduled by threads on each CPU, added to the corresponding work queue, and scheduled for execution when the CPU is idle.
[0048] 3: For unimportant tasks, set a timer to execute them when the time is up.
[0049] The processing methods for these three types of tasks are also different. For the first, very important task, a synchronous execution method using tasklets (tasklets are a lightweight software interrupt mechanism in the Linux kernel; they are functions that run in the computer kernel and are used to schedule delayed functions and handle software interrupts outside the main run queue) is generally used, meaning immediate execution. For the second type, scheduling is done through threads on each CPU, adding the task to the corresponding work queue, and scheduling the task for execution when the CPU is idle. For the third type, a timer is set, and the corresponding task is executed after the timer expires, such as... Figure 5 As shown.
[0050] go through Figure 6 It was found that if the priority of the corresponding task is set too low, the likelihood of the task being executed is relatively low; even if the CPU is idle, the task may not be executed. Therefore, the priority of the task is modified to ensure that the corresponding task will be executed immediately whenever the CPU has idle time. The specific modified code is shown below:
[0051] Modification method:
[0052] #ccflags-y+=-DCONFIG_ATBM_SELF_WORKQUEUE is modified to: ccflags-y+=-DCONFIG_ATBM_SELF_WORKQUEUE;
[0053] #define WQ_THREAD_PR 0 should be changed to #define WQ_THREAD_PR 99 / / Priority range 0-99, 0 is the lowest priority, and 99 is the highest priority.
[0054] Work queues typically have three states: creation, execution, and destruction after execution. Figure 7 As shown, this means destroying the work queue, thereby releasing the work queue.
[0055] The key point of this invention is to identify problems in actual testing, solve them from a fundamental perspective, and provide the root cause. After modification, approximately 200 stress tests were conducted without any issues, indicating that the modification method is reliable and effective. By analyzing this modification method, the work queue-related parts were further summarized and categorized. By modifying the task priority, it was ensured that the task could be executed. The reason why this problem occurs during screen mirroring is mainly because audio and video transmission and processing occur after screen mirroring, which consumes a lot of CPU. Work queue scheduling needs to be completed during CPU idle periods. When CPU utilization is high, low-priority tasks scheduled to the work queue may not be executed, leading to null pointer exceptions. Here, by optimizing the task priority, tasks are still executed even when CPU utilization is high, which has great reference value and can be used as a general method for handling kernel interrupts.
[0056] Furthermore, such as Figure 8 As shown, based on the above-described method for handling screen mirroring crashes, the present invention also provides a system for handling screen mirroring crashes, wherein the system for handling screen mirroring crashes includes:
[0057] Information acquisition module 51 is used to receive test feedback. If a kernel crash occurs after pressing the exit button after screen projection, log information is captured.
[0058] The function printing module 52 is used to search for processing tasks from the kernel based on the log information and directly print the problematic function from the functions embedded by the main IC chip manufacturer.
[0059] The cause localization module 53 is used to search in the driver and determine the root cause of the problem based on the pointer assignment when exiting screen mirroring.
[0060] Furthermore, such as Figure 9 As shown, based on the above-mentioned screen mirroring crash handling method and system, the present invention also provides a terminal, which includes a processor 10, a memory 20 and a display 30. Figure 9 Only some of the terminal components are shown; however, it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0061] In some embodiments, the memory 20 may be an internal storage unit of the terminal, such as a hard disk or memory. In other embodiments, the memory 20 may be an external storage device of the terminal, such as a plug-in hard disk, smart media card (SMC), secure digital card (SD), flash card, etc. Further, the memory 20 may include both internal and external storage devices. The memory 20 is used to store application software and various types of data installed on the terminal, such as the program code installed on the terminal. The memory 20 can also be used to temporarily store data that has been output or will be output. In one embodiment, the memory 20 stores a screen mirroring crash handling program 40, which can be executed by the processor 10 to implement the screen mirroring crash handling method of this application.
[0062] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor, or other data processing chip, used to run program code stored in the memory 20 or process data, such as executing the screen projection crash handling method.
[0063] In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen. The display 30 is used to display information on the terminal and to display a visual user interface. The components 10-30 of the terminal communicate with each other via a system bus.
[0064] In one embodiment, when the processor 10 executes the screen projection crash handling program 40 in the memory 20, the following steps are performed:
[0065] Receive test feedback; if a kernel crash occurs after pressing the exit button after screen mirroring, capture the log information.
[0066] Based on the log information, the kernel is searched for processing tasks, and the problematic function is directly printed out from the function embedded by the main IC chip manufacturer.
[0067] Search for tasks in the driver and determine the root cause of the kernel crash based on the pointer assignment when exiting screen mirroring.
[0068] The test feedback refers to the problems discovered by the testers during the testing process.
[0069] The log information includes on-site information when the problem occurred, and the possible causes of the kernel crash can be queried through the on-site information.
[0070] The driver is used to place processing tasks into a queue. When an interrupt occurs, the CPU retrieves the task from the queue and processes it.
[0071] In the Wi-Fi driver, all tasks are broken down into individual work tasks and scheduled to a work queue by the CPU, which then executes the relevant tasks.
[0072] These tasks are categorized based on their importance and priority:
[0073] Important tasks that need to be executed immediately can be executed synchronously using tasklets.
[0074] Tasks of secondary importance do not need to be executed immediately. They are scheduled by threads on each CPU, added to the corresponding work queue, and then scheduled for execution when the CPU is idle.
[0075] For unimportant tasks, a timer can be set to execute them when the time is up.
[0076] If the priority of the corresponding task is set to low, the probability of the task being executed is low. Even if the CPU is idle, the task may not be executed. By modifying the priority of the task, it can be ensured that the corresponding task will be executed immediately as long as the CPU has idle time.
[0077] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a screen mirroring crash handling program, and when the screen mirroring crash handling program is executed by a processor, it implements the steps of the screen mirroring crash handling method described above.
[0078] In summary, this invention provides a method and related equipment for handling screen mirroring crashes. The method includes: receiving test feedback; if a kernel crash occurs after pressing the exit button following screen mirroring, capturing log information; searching for processing tasks in the kernel based on the log information, and directly printing the problematic function in the function embedded by the main IC chip manufacturer; searching for tasks in the driver, and determining the root cause of the kernel crash based on the pointer assignment when exiting screen mirroring. This invention solves the kernel crash problem caused by pressing the exit button after screen mirroring in actual use. From the perspective of the actual user, it derives the cause of the problem through a series of analyses and summaries, and then locates the corresponding module through modular analysis, thereby finding the root cause of the problem.
[0079] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal that includes that element.
[0080] Of course, those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware (such as a processor, controller, etc.). The program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The computer-readable storage medium can be a memory, magnetic disk, optical disk, etc.
[0081] It should be understood that the application of the present invention is not limited to the examples above. Those skilled in the art can make improvements or modifications based on the above description, and all such improvements and modifications should fall within the protection scope of the appended claims.
Claims
1. A method for handling screen mirroring crashes, characterized in that, The methods for handling screen mirroring crashes include: Receive test feedback; if a kernel crash occurs after pressing the exit button after screen mirroring, capture the log information. Based on the log information, the kernel is searched for processing tasks, and the problematic function is directly printed out from the function embedded by the main IC chip manufacturer. Search for tasks in the driver and determine the root cause of the kernel crash based on the pointer assignment when exiting screen mirroring; The driver is used to place processing tasks into a queue. When an interrupt occurs, the CPU retrieves the task from the queue and processes it. In the Wi-Fi driver, all tasks are broken down into individual work tasks and scheduled to the work queue by the CPU, so that the CPU can execute the relevant tasks. Tasks are categorized based on their importance and priority: Important tasks that need to be executed immediately can be executed synchronously using tasklets. Tasks of secondary importance do not need to be executed immediately. They are scheduled by threads on each CPU, added to the corresponding work queue, and then scheduled for execution when the CPU is idle. For unimportant tasks, a timer can be set to execute them when the time is up. From the perspective of actual users, a series of analyses and summaries are used to determine the causes of the problems. Modular analysis is then used to locate the corresponding modules and find the root cause of the problems.
2. The method for handling screen mirroring crashes according to claim 1, characterized in that, The test feedback refers to the problems discovered by the testers during the testing process.
3. The method for handling screen mirroring crashes according to claim 1, characterized in that, The log information includes on-site information when the problem occurred, and the cause of the kernel crash can be found by querying the on-site information.
4. The method for handling screen mirroring crashes according to claim 1, characterized in that, If the priority of the corresponding task is set to low, the probability of the task being executed is low. By modifying the priority of the task, we can ensure that the corresponding task will be executed as long as the CPU has idle time.
5. A system for handling screen mirroring crashes, characterized in that, The screen mirroring crash handling system is used to implement the screen mirroring crash handling method according to any one of claims 1-4, and the screen mirroring crash handling system includes: The information acquisition module is used to receive test feedback. If a kernel crash occurs after pressing the exit button after screen mirroring, the module will capture log information. The function printing module is used to search for processing tasks from the kernel based on the log information and directly print out the problematic function from the functions embedded by the main IC chip manufacturer. The cause localization module is used to search within the driver and determine the root cause of the problem based on the pointer assignment when exiting screen mirroring.
6. A terminal, characterized in that, The terminal includes: a memory, a processor, and a screen mirroring crash handling program stored in the memory and executable on the processor. When the screen mirroring crash handling program is executed by the processor, it implements the steps of the screen mirroring crash handling method as described in any one of claims 1-4.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a screen mirroring crash handling program, which, when executed by a processor, implements the steps of the screen mirroring crash handling method as described in any one of claims 1-4.