Display device and system monitoring method
By introducing a virtual monitoring timer set and monitoring manager into the display device, fine-grained monitoring of subtask execution units is achieved, solving the problem that the main application cannot effectively monitor subtask anomalies and improving the stability and reliability of the system.
Patent Information
- Application Number
- CN202411162041.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-22
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2044-08-22
AI Technical Summary
In existing display devices, the main application cannot effectively monitor abnormal situations of subtasks, such as deadlocks or excessively long business processing times, resulting in insufficient system stability and reliability.
A set of virtual monitoring timers is introduced, which is managed by the first controller to achieve fine-grained monitoring of subtask execution units. Combined with the monitoring manager, status indicators and count values are detected, and timeout thresholds are dynamically adjusted to trigger system restart.
It enables timely monitoring and anomaly response for subtasks, improving the stability and reliability of the system and enabling better handling of subtask exceptions.
Smart Images

Figure CN119135993B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of display device technology, and in particular to a display device and system monitoring method. Background Technology
[0002] Display devices refer to terminal devices capable of outputting specific display images, such as smart TVs, communication terminals, smart advertising screens, and projectors. Taking smart TVs as an example, smart TVs are television products based on Internet application technologies, possessing open operating systems and chips, and having open application platforms. They enable two-way human-computer interaction and integrate multiple functions such as audio-visual, entertainment, and data to meet diverse and personalized user needs.
[0003] To improve system reliability and stability, display devices can be configured with a system watchdog timer (WDT) to monitor the system's operational status. During operation, the WDT's count increments or decrements based on the system clock or an independent internal clock. The main application running on the display device periodically sends a clear signal to the watchdog timer at preset time intervals to reset the WDT's count and restart it. If the operating system or other factors cause an error in the main application, the clear signal will cease. Without a clear signal, the WDT's count continues to increment or decrement. When it reaches a preset overflow value, a system restart is triggered, thus monitoring and handling system faults.
[0004] The aforementioned monitoring mechanism is bound to the main application of the display device, and its granularity is too coarse. Since the main application itself cannot be aware of the status of subtasks, it cannot effectively monitor abnormal situations such as deadlocks or excessively long business processing times that occur in subtasks running in the main application. Summary of the Invention
[0005] This application provides a method for monitoring display devices and systems to solve the problem that subtasks running in the main application cannot be monitored.
[0006] In a first aspect, this application provides a display device, including a display, a first controller, and a second controller. The display is configured to display a user interface; the first controller is configured to run a main application, the main application including a monitoring manager and multiple subtask execution units; the second controller is configured to run a system monitoring timer; the first controller is configured to:
[0007] In response to a wake-up command for waking up the subtask execution unit, the virtual monitoring timer associated with the subtask execution unit is searched in the set of virtual monitoring timers;
[0008] Set the status flag of the virtual monitoring timer to a first flag, the first flag being used to indicate that the subtask execution unit is in a running state;
[0009] The target service is executed through the subtask execution unit, and the count value of the virtual monitoring timer is cleared after the target service is executed.
[0010] At a first time threshold interval, the monitoring manager detects the count value of the virtual monitoring timer in the set of virtual monitoring timers whose status identifier is the first identifier;
[0011] If the count value of the virtual monitoring timer is less than or equal to the second time threshold, a clear signal is sent to the second controller, and the count value of the virtual monitoring timer is increased by the first time threshold; the second time threshold is set based on the business processing time of the subtask execution unit.
[0012] If the count value of the virtual monitoring timer is greater than the second time threshold, a clear signal is not sent to the second controller;
[0013] The second controller is configured as follows:
[0014] In response to the clear signal, the count value of the system monitoring timer is reset;
[0015] When the count value of the system monitoring timer exceeds the third time threshold, a reset signal is sent to the first controller to restart the first controller.
[0016] In an optional implementation, before the first controller performs the step of searching for the virtual monitoring timer associated with the subtask execution unit in the set of virtual monitoring timers, it is further configured to:
[0017] Obtain the subtask identifier and second time threshold of the subtask execution unit;
[0018] Obtain the set of virtual monitoring timers;
[0019] In the set of virtual monitoring timers, a virtual monitoring timer is registered based on the subtask identifier and the second time threshold, and the virtual monitoring timer is a data structure object.
[0020] In an optional implementation, the step of the first controller performing the acquisition of the second time threshold is further configured to:
[0021] The business processing time of the subtask execution unit, the first time threshold, and the third time threshold are obtained; the business processing time is the average processing time of the subtask execution unit executing the target business multiple times;
[0022] A second time threshold is calculated based on the business processing time, the first time threshold, and the third time threshold. The second time threshold is the product of the business processing time, the first time threshold, and the third time threshold.
[0023] In an optional implementation, the first controller is further configured to:
[0024] In response to a sleep command for putting the subtask execution unit to sleep, the virtual monitoring timer associated with the subtask execution unit is searched in the set of virtual monitoring timers;
[0025] The status flag of the virtual monitoring timer is set to a second flag, which is used to indicate that the subtask execution unit is in a sleep state.
[0026] In an optional implementation, the first controller is further configured to:
[0027] Read the status identifier of the virtual monitoring timer in the set of virtual monitoring timers;
[0028] If the status identifier of the virtual monitoring timer is the first identifier, then the count value of the virtual monitoring timer is detected;
[0029] If the status identifier of the virtual monitoring timer is the second identifier, then the count value of the virtual monitoring timer is not detected.
[0030] In an optional implementation, a memory is also included, and if the count value of the virtual monitoring timer is greater than a second time threshold, the first controller is further configured to:
[0031] Obtain the status data of the subtask execution unit;
[0032] The state data is stored in the memory.
[0033] In an optional implementation, if the count value of the virtual monitoring timer is greater than the second time threshold, the first controller is further configured to:
[0034] Send a clear signal to the second controller;
[0035] Send a third time threshold to the second controller;
[0036] The second controller is also configured to:
[0037] In response to the clear signal, the count value of the system monitoring timer is reset;
[0038] The system receives a third time threshold sent by the first controller and changes the initial time threshold of the system monitoring timer to the third time threshold, wherein the third time threshold is less than the initial time threshold.
[0039] In an optional implementation, if the count value of the virtual monitoring timer is greater than the second time threshold, the first controller is further configured to:
[0040] A sleep period is set, wherein the sleep duration corresponding to the sleep period is greater than the third time threshold;
[0041] Get the current time;
[0042] If the current time is within the sleep period, no clear signal is sent to the system monitoring timer.
[0043] In an optional implementation, after the first controller performs the step of setting the status flag of the virtual monitoring timer to the first flag, it is further configured to:
[0044] Execute the target business logic in a loop;
[0045] Monitor the single execution completion event of the target service;
[0046] In response to the detected single execution end event of the target service, the count value of the virtual monitoring timer is cleared.
[0047] Secondly, this application also provides a system monitoring method applied to the aforementioned display device, the method comprising:
[0048] In response to the wake-up command of the subtask execution unit, the first controller searches for the virtual monitoring timer associated with the subtask execution unit in the set of virtual monitoring timers;
[0049] Set the status flag of the virtual monitoring timer to a first flag, the first flag being used to indicate that the subtask execution unit is in a running state;
[0050] The target service is executed through the subtask execution unit, and the count value of the virtual monitoring timer is cleared after the target service is executed.
[0051] At a first time threshold interval, the monitoring manager detects the count value of the virtual monitoring timer in the set of virtual monitoring timers whose status identifier is the first identifier;
[0052] If the count value of the virtual monitoring timer is less than or equal to the second time threshold, a clear signal is sent to the second controller, and the count value of the virtual monitoring timer is increased by the first time threshold; the second time threshold is set based on the business processing time of the subtask execution unit.
[0053] If the count value of the virtual monitoring timer is greater than the second time threshold, a clear signal is not sent to the second controller;
[0054] In response to the clear signal, the second controller resets the count value of the system monitoring timer;
[0055] When the count value of the system monitoring timer exceeds the third time threshold, a reset signal is sent to the first controller to restart the first controller.
[0056] As can be seen from the above technical solutions, some embodiments of this application provide a display device and system monitoring method. This method can, when a subtask execution unit enters the running state, search for the virtual monitoring timer associated with the subtask execution unit in a set of virtual monitoring timers and set the status identifier of the virtual monitoring timer to a first identifier. The subtask execution unit then executes the target service, and after the target service is completed, the count value of the virtual monitoring timer is cleared. Simultaneously, at intervals of a first time threshold, the monitoring manager can detect the count value of the virtual monitoring timer with the first identifier in the set of virtual monitoring timers. If the count value is less than or equal to a second time threshold, a clear signal is sent to the system monitoring timer, and the count value is increased by the first time threshold. If the count value is greater than the second time threshold, no clear signal is sent to the system monitoring timer, so that the count value of the system monitoring timer exceeds a third time threshold, thereby triggering a system restart. This method achieves fine-grained monitoring of tasks by setting a set of virtual monitoring timers. The set of virtual monitoring timers provides functions such as registration, enabling, counting, clearing, and disabling, and has flexible timeout trigger thresholds to meet the operational needs of different subtasks. Subtask monitoring can be dynamically enabled and disabled. It provides a unified monitoring manager to simplify control and uses short timeout threshold switching to trigger more timely and effective identification of abnormal subtasks. Attached Figure Description
[0057] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0058] Figure 1This is a schematic diagram illustrating an operational scenario between a display device and a control device provided in some embodiments of this application;
[0059] Figure 2 This is a schematic diagram of the hardware configuration of a display device provided in some embodiments of this application;
[0060] Figure 3 This is a schematic diagram of the software configuration of a display device provided in some embodiments of this application;
[0061] Figure 4 A schematic diagram illustrating application-level granular monitoring provided in some embodiments of this application;
[0062] Figure 5 A schematic diagram illustrating subtask granularity monitoring provided in some embodiments of this application;
[0063] Figure 6 A schematic diagram illustrating system monitoring provided for some embodiments of this application;
[0064] Figure 7 A flowchart illustrating a system monitoring method provided in some embodiments of this application;
[0065] Figure 8 A schematic diagram illustrating the short timeout threshold switching process provided in some embodiments of this application;
[0066] Figure 9 A flowchart illustrating the dynamic enabling and disabling of subtask monitoring provided in some embodiments of this application;
[0067] Figure 10 This is a schematic diagram of the subtask monitoring process provided in some embodiments of this application. Detailed Implementation
[0068] The embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described below do not represent all embodiments consistent with this application. They are merely examples of systems and methods consistent with some aspects of this application as detailed in the claims.
[0069] It should be noted that the brief descriptions of terms in this application are only for the convenience of understanding the embodiments described below, and are not intended to limit the embodiments of this application. Unless otherwise stated, these terms should be understood in their ordinary and common meaning.
[0070] The terms "first," "second," "third," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar or related objects or entities, and do not necessarily imply a specific order or sequence, unless otherwise specified. It should be understood that such terms are interchangeable where appropriate.
[0071] The terms “comprising” and “having”, and any variations thereof, are intended to cover but not exclude inclusion, for example, a product or device that includes a range of components is not necessarily limited to all of the components that are clearly listed, but may include other components that are not clearly listed or that are inherent to such product or device.
[0072] The term "module" refers to any known or subsequently developed hardware, software, firmware, artificial intelligence, fuzzy logic, or combination of hardware and / or software code that is capable of performing the functions associated with that element.
[0073] In this embodiment, the display device 200 generally refers to a device with screen display and data processing capabilities. For example, the display device 200 includes, but is not limited to, smart TVs, mobile terminals, computers, monitors, advertising screens, wearable devices, virtual reality devices, augmented reality devices, etc.
[0074] Figure 1 This is a schematic diagram illustrating an operational scenario between a display device and a control device provided in some embodiments of this application. For example... Figure 1 As shown, a user can operate the display device 200 via touch operation, a mobile terminal 300, and a control device 100. The control device 100 receives user input commands and converts them into control commands that the display device 200 can recognize and respond to. For example, the control device 100 can be a remote control, a stylus, a gamepad, etc.
[0075] The mobile terminal 300 can function as a control device for human-computer interaction between the user and the display device 200. It can also function as a communication device for establishing a communication connection with the display device 200 and exchanging data. In some embodiments, the mobile terminal 300 can have software applications installed on it and communicate with the display device 200 via network communication protocols to achieve one-to-one control and data communication. Furthermore, it can transmit audio and video content displayed on the mobile terminal 300 to the display device 200 for synchronized display.
[0076] In some embodiments, the mobile terminal 300 or other electronic devices may also simulate the functions of the control device 100 by running an application that controls the display device 200.
[0077] like Figure 1The diagram also shows that the display device 200 communicates with the server 400 via various communication methods. This allows the display device 200 to communicate via a local area network (LAN), a wireless local area network (WLAN), and other networks.
[0078] Display device 200 can provide broadcast television reception function, and can also be equipped with intelligent network television function that provides computer support, including but not limited to network television, smart television, Internet Protocol television (IPTV), etc.
[0079] Figure 2 Provided for some embodiments of this application Figure 1 Hardware configuration block diagram of display device 200.
[0080] In some embodiments, the display device 200 may include at least one of a tuner 210, a communication device 220, a detector 230, a device interface 240, a controller 250, a display 260, an audio output device 270, a memory, a power supply, and a user input interface 280.
[0081] In some embodiments, detector 230 is used to acquire signals from the external environment or to interact with the outside world. For example, detector 230 includes a light receiver, a sensor for acquiring ambient light intensity; or, detector 230 includes an image acquisition device, such as a camera, which can be used to acquire external environmental scenes, user attributes, or user interaction gestures; or, detector 230 includes a sound acquisition device, such as a microphone, for receiving external sounds.
[0082] In some embodiments, the display 260 includes display function components for presenting images and driving components for driving image display. The display 260 is used to receive and display image signals output from the controller 250. For example, the display 260 can be used to display video content, image content, menu control interface components, and user control UI interfaces, etc.
[0083] In some embodiments, the communication device 220 is a component used to communicate with external devices or the server 400 according to various communication protocol types. The display device 200 may have multiple communication devices 220 depending on the supported communication methods. For example, when the display device 200 supports wireless network communication, it may have a communication device 220 with WiFi functionality. When the display device 200 supports Bluetooth connectivity, it needs to have a communication device 220 with Bluetooth functionality.
[0084] The communication device 220 enables the display device 200 to communicate with external devices or the server 400 via wireless or wired connections. Wired connections utilize data cables, interfaces, or other components to connect the display device 200 to external devices. Wireless connections utilize wireless signals or wireless networks. The display device 200 can directly establish a connection with external devices or indirectly through gateways, routers, or other connection devices.
[0085] In some embodiments, the controller 250 may include at least one of a central processing unit, a video processor, an audio processor, a graphics processor, and a power processor, and a first to an nth interface for input / output. The controller 250 controls the operation of the display device and responds to user operations through various software control programs stored in memory. The controller 250 controls the overall operation of the display device 200.
[0086] In some embodiments, the controller 250 and the tuner 210 may be located in different separate devices, that is, the tuner 210 may also be located in an external device of the main device where the controller 250 is located, such as an external set-top box.
[0087] In some embodiments, a user can input user commands through a graphical user interface (GUI) displayed on a display 260, and the user input interface receives user input commands through the graphical user interface (GUI).
[0088] In some embodiments, the audio output device 270 can be a built-in speaker of the display device 200 or an external audio output device connected to the display device 200. For the external audio output device connected to the display device 200, the display device 200 may also be provided with an external audio output terminal, through which the audio output device can be connected to the display device 200 to output sound from the display device 200.
[0089] In some embodiments, the user input interface 280 can be used to receive instructions from user input.
[0090] To enable user interaction, in some embodiments, the display device 200 may run an operating system. The operating system is a computer program used to manage and control the hardware and software resources of the display device 200. The operating system can control the display device to provide a user interface; for example, the operating system can directly control the display device to provide a user interface, or it can provide a user interface by running an application. The operating system also allows users to interact with the display device 200.
[0091] It should be noted that the operating system can be a native operating system based on a specific operating platform, a third-party operating system that is deeply customized based on a specific operating platform, or an independent operating system specifically developed for display devices.
[0092] An operating system can be divided into different modules or levels based on the functions it implements, for example... Figure 3 As shown, in some embodiments, the system is divided into four layers, from top to bottom: the Applications layer (referred to as the "Application Layer"), the Application Framework layer (referred to as the "Framework Layer"), the System Library layer, and the Kernel layer.
[0093] In some embodiments, the application layer provides services and interfaces for applications, enabling the display device 200 to run applications and interact with the user based on the applications. The application layer may contain at least one application, which may be a built-in Windows program, system settings program, or clock program of the operating system; or it may be an application developed by a third-party developer. In specific implementations, the application packages in the application layer are not limited to the examples above.
[0094] The framework layer provides application programming interfaces (APIs) and a programming framework for applications. The application framework layer includes predefined functions. It acts as a central processing unit, determining the actions taken by applications within the application layer. Through the API, applications can access system resources and obtain system services during execution.
[0095] like Figure 3 As shown, Figure 3 The diagram below illustrates the software configuration of a display device according to some embodiments of this application. In some embodiments, the system of the display device 200 can be divided into three layers, from top to bottom: the application layer, the middleware layer, and the hardware layer.
[0096] The application layer mainly includes TV applications and application frameworks. The applications are mainly browser-based applications, such as HTML5 apps, and native apps.
[0097] An application framework is a complete program model that has all the basic functions required by standard application software, such as file access, data exchange, and the user interface for these functions (toolbar, status bar, menu, dialog box).
[0098] Native apps can support online or offline access, push notifications, or access to local resources.
[0099] The middleware layer includes various television protocols, multimedia protocols, and system components. Middleware can use the basic services (functions) provided by system software to connect different parts of application systems or different applications on the network, achieving resource sharing and function sharing.
[0100] The hardware layer mainly includes the HAL interface, hardware, and drivers. The HAL interface is a unified interface for all TV chips, with the specific logic implemented by each chip. The drivers mainly include: audio drivers, display drivers, Bluetooth drivers, camera drivers, Wi-Fi drivers, USB drivers, HDMI drivers, sensor drivers (such as fingerprint sensors, temperature sensors, pressure sensors, etc.), and power drivers.
[0101] It should be noted that the above examples are merely a simple division of operating system functions and do not limit the specific form of the operating system of the display device 200 in this application embodiment. Depending on the function of the display device, the type of operating system, and other factors, the number of levels and the specific level type of the operating system may be expressed in other forms.
[0102] In some embodiments, to improve system reliability and stability, the display device 200 can set a system monitoring timer, also known as a watchdog timer (WDT), to monitor the system's operating status. For example... Figure 4The diagram illustrates the application-level granular monitoring provided in this embodiment. The motherboard of the display device 200 integrates a Central Processing Unit (CPU) and a Power Microcontroller (PM). The CPU runs the main application program, which is the core program of the display device 200 system, responsible for managing and coordinating various functions and services of the display device 200, including system initialization, task scheduling, and user interface interaction. The PM processor runs a system monitoring timer. During the operation of the display device 200, the count value of the system monitoring timer continuously increases or decreases according to the system clock source or an independent internal clock source. The main application program running in the display device 200 periodically sends a clear signal to the system monitoring timer at preset time intervals to reset the count value of the system monitoring timer and restart the counting process. When the operating system running on the display device 200 causes an abnormality in the main application program, the sending of the clear signal will stop.
[0103] The system monitoring timer continuously increments or decrements its count if no clear signal is received. When it reaches a preset overflow value, it triggers a system restart. The system monitoring timer sends a reset signal to the central processing unit (CPU) via the connection pin between the CPU and the main processing unit (PM). In response to the reset signal, the CPU performs a reset operation to restart itself, reload the operating system and main application, thereby enabling the monitoring and handling of system faults.
[0104] In some embodiments, the main application includes different subtask execution units to perform different business operations, thereby improving business execution efficiency. For example, the application manager subtask is responsible for service switching and key distribution, while the burning subtask is responsible for storing audio and video data. When these subtask execution units are in a hotspot running state, the synchronization control accompanying data competition may lead to deadlock, resulting in abnormal overall system operation, such as screen freezing. Due to the limited number of system monitoring timer modules and the difficulty for the main application to perceive the running status of numerous subtasks, the main application continuously sends clear signals, making it impossible to monitor subtask anomalies in a timely and effective manner.
[0105] As can be understood, within the main application, a subtask execution unit is an independent execution unit within the main application, dedicated to performing a specific business function. The main application can contain multiple threads that execute in parallel or concurrently; a subtask execution unit refers to an execution thread entity within the main application. Hotspot running state refers to a subtask execution unit entering a business loop for processing during normal operation or when awakened, and not automatically switching to a sleep or exit state without external event control.
[0106] The aforementioned monitoring mechanism is bound to the main application of the display device 200. The granularity of this mechanism is too coarse. Because the main application itself cannot perceive the status of subtasks, it cannot effectively monitor abnormal situations such as deadlocks or excessively long processing times in the execution units of subtasks running within the main application. This results in the system not being able to be restarted in a timely manner when subtask execution units malfunction. Furthermore, the large number of subtasks means that system resources cannot meet the monitoring requirements at this granular level.
[0107] Therefore, some embodiments of this application provide a system monitoring method applied to the aforementioned display device 200 to achieve fine-grained subtask operation monitoring, thereby providing more comprehensive monitoring of the entire system and improving system stability and reliability. To facilitate the implementation of the system monitoring method, the display device 200 includes: a display 260, a first controller 251, and a second controller 252. The display 260 is configured to display a user interface. The first controller 251 runs a main application, which includes a monitoring manager and multiple subtask execution units. The second controller 252 runs a system monitoring timer.
[0108] It should be noted that by running the main application and the system monitoring timer on different controllers, the second controller 252 can still run the system monitoring timer when the main application encounters an error, thus triggering the first controller 251 to restart in a timely manner, thereby improving the stability and reliability of the system.
[0109] like Figure 5 The diagram shown is a schematic of subtask-level monitoring provided in an embodiment of this application. The first controller 251 is a central processing unit (CPU), and the second controller 252 is a PM processor. The method is executed by the CPU running the main application and the PM processor running the system monitoring timer. The two controllers can exchange clear signals via a Universal Asynchronous Receiver Transmitter (UART) bus.
[0110] To achieve subtask-level monitoring, a set of virtual watchdog timers is set up. This set includes multiple virtual watchdog timers (VWDTs). These virtual watchdog timers are associated with the subtask execution units of the main application, thus enabling monitoring of the subtask execution units based on the virtual watchdog timers.
[0111] It should be noted that the virtual monitoring timer is a data structure object stored in the virtual monitoring timer set. Each subtask execution unit corresponds to one virtual monitoring timer. By incrementing and clearing the count value of the virtual monitoring timer, the running status of the subtask execution unit can be monitored. The system monitoring timer is a hardware or software module used to implement the timing mechanism. It can automatically increment the count value based on a clock source, reset the count value based on a clear signal, and trigger the first controller 251 to restart when the count value is exceeded.
[0112] like Figure 5 , 6 As shown, the virtual monitoring timer set provides functions such as registration, enabling, counting, clearing, and disabling. The monitoring manager can manage the virtual monitoring timer set, perform threshold detection, short timeout threshold switching, counting, and reset control of system monitoring timers. The following table shows the attribute and behavior definitions of the virtual monitoring timers:
[0113]
[0114] In some embodiments, a virtual monitoring timer corresponding to a subtask execution unit can be registered in a set of virtual monitoring timers based on the subtask identifier and the second time threshold of the subtask execution unit. That is, when a subtask execution unit is created, it can register its own subtask identifier and second time threshold to the set of virtual monitoring timers. In other words, a data structure object bound to the subtask execution unit is created in the set of virtual monitoring timers as a virtual monitoring timer. This data structure object records information such as the second time threshold, subtask identifier, count value, and status flag of the subtask execution unit.
[0115] For example, the subtask identifier can be the name of the subtask execution unit, with a length ranging from 4 to 27 characters, consisting of numbers and letters. Each subtask execution unit has a unique name. By registering the name of the subtask execution unit and the second time threshold to the set of virtual monitoring timers, the corresponding virtual monitoring timer can be quickly found based on the name of the subtask execution unit.
[0116] In some embodiments, to achieve differentiated monitoring, the second time threshold can be set based on the business processing time of the subtask execution unit, enabling the subtask execution unit to have an independent timeout threshold trigger, flexibly meeting the differences in business processing time of subtasks. The calculation of the second time threshold can be achieved by obtaining the business processing time of the subtask execution unit, the first time threshold, and the third time threshold. The second time threshold is calculated based on the business processing time, the first time threshold, and the third time threshold according to the following formula:
[0117] Tv=tn*t0*T
[0118] Where Tv is the second time threshold, which is the product of the business processing time, the first time threshold, and the third time threshold. tn is the business processing time, which is the processing time for the subtask execution unit to execute the target business. t0 is the first time threshold, which is the time interval for the monitoring manager to send a clear signal. T is the third time threshold, which is the timeout trigger threshold for the system monitoring timer.
[0119] For example, such as Figure 6 As shown, the main application includes n sub-task execution units, namely Task 1, Task 2, Task 3, ..., Task n. The business processing time of Task 1, Task 2, Task 3, ..., Task n are t1, t2, ..., tn, respectively. The virtual monitoring timers registered in the virtual monitoring timer set for Task 1, Task 2, ..., Task n are VWDT1, VWDT2, ..., VWDTn, respectively.
[0120] If the processing time t1 of task 1 is 3s, the first time threshold t0 is 1s, and the third time threshold T is 30s, then the second time threshold corresponding to VWDT1 is 90s. If the processing time t2 of task 2 is 5.5s, the first time threshold t0 is 1s, and the third time threshold T is 30s, then the second time threshold corresponding to VWDT2 is 165s.
[0121] In some embodiments, to reduce the impact of deviations caused by system scheduling jitter, the business processing time of the subtask execution unit is measured and obtained by averaging. That is, the business processing time is the average of the processing time of the subtask execution unit executing the target business multiple times. For example, the system timestamp when the subtask execution unit starts executing the target business and the system timestamp when the subtask execution unit completes executing the target business are obtained. The two system timestamps are subtracted to obtain the processing time of a single execution of the target business. The processing time of the subtask execution unit executing the target business 10 times is calculated, and the average of the 10 execution times is obtained to obtain the business processing time.
[0122] In some embodiments, the corresponding virtual monitoring timer can be dynamically enabled or disabled based on the state of the subtask execution unit to trigger the monitoring manager to monitor and stop monitoring the subtask execution unit. That is, when the subtask execution unit completes registration, the monitoring manager will not monitor it. When the subtask execution unit is awakened and enters the running state, an enable operation is performed to trigger the monitoring manager to monitor it. When the subtask execution unit exits and enters a hibernation or exit state, a disable operation is performed to trigger the monitoring manager to de-monitor.
[0123] In some embodiments, for monitoring the running status of a subtask execution unit, the subtask execution unit periodically clears the count value of the virtual monitoring timer, restoring the virtual monitoring timer to its initial value (e.g., 0). The monitoring manager periodically performs threshold checks on the virtual monitoring timer and increments the count value of the virtual monitoring timer.
[0124] For subtask execution units that are not in a hotspot running state, the subtask execution unit will automatically enter a sleep or exit state after executing the target service. In response, the execution end event of the target service can be monitored, and the count value of the virtual monitoring timer can be cleared upon detection of the execution end event of the target service. That is, the count value of the virtual monitoring timer is cleared after the target service is executed.
[0125] For subtask execution units in a hotspot running state, without external event control, these units will enter a business loop, repeatedly executing the target business. To address this, the execution completion event of a single instance of the target business can be monitored. In response to this event, the count value of the virtual monitoring timer is cleared. That is, the virtual monitoring timer count value is cleared once the target business is executed.
[0126] Based on the incrementing and clearing operations of the virtual monitoring timer's count, if a running subtask execution unit experiences an abnormal situation such as deadlock or excessively long processing time during business execution, the action of clearing the virtual monitoring timer's count will be stopped. The count of the virtual monitoring timer corresponding to the subtask execution unit will continuously increment, causing the virtual monitoring timer's count to exceed the second time threshold. When the monitoring manager detects that the count of any virtual monitoring timer in the virtual monitoring timer set exceeds the second time threshold, it will output the status data of the corresponding subtask execution unit to memory for storage, for subsequent analysis. It will also perform a short timeout threshold switch, reconfiguring the system monitoring timer's timeout trigger threshold T to a shorter time threshold. Within this time threshold, no clear signal will be sent to the system monitoring timer, causing the system monitoring timer's count to exceed the reconfigured short time threshold, thereby triggering a system restart.
[0127] The system monitoring method provided in the embodiments of this application is described below with reference to the accompanying drawings. Figure 7 The diagram shown is a flowchart illustrating the system monitoring method provided in this application embodiment. The subtask execution unit includes the following steps:
[0128] S701: In response to the wake-up command, enter the running state and search for the virtual monitor timer associated with the subtask execution unit in the set of virtual monitor timers.
[0129] S702: Perform an enable operation on the virtual monitoring timer, setting the status flag of the virtual monitoring timer to the first flag, thereby triggering the monitoring manager to perform threshold detection and counter increment on the virtual monitoring timer.
[0130] S703: Execute the target business.
[0131] S704: After the target service is completed, clear the count value of the virtual monitoring timer.
[0132] S705: In response to a hibernation command, before entering hibernation, it searches for the virtual monitor timer associated with the subtask execution unit in the set of virtual monitor timers.
[0133] S706: Perform an enable operation to set the status flag of the virtual monitoring timer to the second flag, thereby triggering the monitoring manager to prevent threshold detection and counter increment for the virtual monitoring timer.
[0134] For the monitoring manager, the following steps are included:
[0135] S707: Read the status identifier of the virtual monitoring timer in the virtual monitoring timer set at intervals of the first time threshold. If the status identifier of the virtual monitoring timer is the first identifier, proceed to step S708. If the status identifier of the virtual monitoring timer is the second identifier, do not proceed to step S708.
[0136] S708: Detect the count value of the virtual monitoring timer. If the count value of the virtual monitoring timer is less than or equal to the second time threshold, it indicates that the subtask execution unit is operating normally, and steps S709-S710 are executed. If the count value of the virtual monitoring timer is greater than the second time threshold, it indicates that the subtask execution unit is malfunctioning, and steps S711-S712 are executed. A clear signal is not sent to the system monitoring timer in the second controller 252, allowing the count value of the system monitoring timer to continuously increment, thereby triggering a system restart in the first controller 251.
[0137] S709: Send a clear signal to the system monitoring timer in the second controller 252.
[0138] S710: Increase the count value of the virtual monitoring timer by the first time threshold.
[0139] S711: Obtain the status data of the subtask execution unit.
[0140] The status data includes the execution stack, register status, memory usage, etc., which are used for anomaly analysis of subsequent subtask execution units.
[0141] S712: Stores state data in memory.
[0142] For system monitoring timers, the following steps are included:
[0143] S713: In response to the clear signal, resets the count value of the system monitoring timer.
[0144] S714: The count value of the system monitoring timer is incremented based on the clock source.
[0145] S715: Detects the count value of the monitoring timer in the detection system.
[0146] S716: When the count value of the system monitoring timer is greater than the third time threshold, a reset signal is sent to the first controller 251 to restart the first controller 251, reload the operating system, and restart the main application.
[0147] In some embodiments, to achieve rapid response when a subtask fails, the monitoring manager checks the count value of the virtual monitoring timer at first time intervals based on a first time threshold. If the count value of the virtual monitoring timer is greater than a second time threshold, a short timeout threshold switch can be performed. Figure 8 The diagram shown is a schematic representation of the short timeout threshold switching process provided in this embodiment of the application. For the monitoring manager, the process includes the following steps:
[0148] S801: Send a clear signal to the system monitoring timer in the second controller 252.
[0149] S802: Send a third time threshold to the system monitoring timer in the second controller 252.
[0150] S803: Set the sleep time period.
[0151] Among them, the hibernation period corresponds to a hibernation duration that is greater than the third time threshold.
[0152] S804: Get the current time. If the current time is within the sleep period, do not send a clear signal to the system monitoring timer.
[0153] For system monitoring timers, the following steps are included:
[0154] S805: In response to the clear signal, resets the count value of the system monitoring timer.
[0155] S806: Receive the third time threshold sent by the monitoring manager in the first controller 251, and change the initial time threshold of the system monitoring timer to the third time threshold, which is less than the initial time threshold.
[0156] Since the sleep duration corresponding to the sleep period is greater than the third time threshold, the system monitoring timer will not receive a clear signal during the sleep period, causing the count value of the system monitoring timer to continuously increase. After the third time threshold, the count value of the system monitoring timer is greater than the third time threshold, thereby triggering the first controller 251 to restart.
[0157] For example, taking Task 1 as an example, the second time threshold corresponding to Task 1 is 90s, and the first time threshold t0 corresponding to the monitoring manager is 1s. The monitoring manager checks the count value of the virtual monitoring timer corresponding to Task 1 every 1s. If the count value of the virtual monitoring timer is greater than 90s, it indicates that Task 1 is abnormal. The status data of Task 1 is then stored in memory, and a short timeout threshold switch is performed, configuring the timeout trigger threshold T of the system monitoring timer to 2s. Simultaneously, the first controller 251 is controlled to hibernate for 5s. During the 5-sleep period, the monitoring manager does not send a clear signal to the system monitoring timer. After 2s, because the first controller 251 is still in hibernation and has not sent a clear signal, the count value of the system monitoring timer in the second controller 252 exceeds 2s, thereby triggering the first controller 251 to restart.
[0158] If the count value of the virtual monitoring timer is detected to be less than or equal to 90 seconds, it indicates that Task 1 is running normally. The timeout trigger threshold T of the system monitoring timer remains unchanged at 30 seconds. A clear signal is sent to the system monitoring timer to reset its count value, and the count value of the virtual monitoring timer corresponding to Task 1 is incremented by 1. The above is one monitoring operation of the monitoring manager. The monitoring manager repeats this process cyclically to achieve monitoring of the operation of Task 1.
[0159] Understandably, whether the system is running normally or the virtual monitoring timer has expired, the monitoring manager can execute the timeout trigger threshold configuration for the system monitoring timer to clear its count and restart it. By extending the interval between clearing signals, while keeping it significantly shorter than the normal interval, the system can promptly report any abnormalities in the subtask execution unit, triggering a system restart.
[0160] like Figure 9The diagram illustrates the process of dynamically enabling and disabling subtask monitoring according to an embodiment of this application. When a subtask execution unit is created, it can write its subtask identifier and second time threshold into the virtual monitoring timer set in the monitoring manager to register the virtual monitoring timer. When the subtask execution unit is awakened and enters the running state, it enables the virtual monitoring timer and sets the status of the virtual monitoring timer to the first identifier to trigger the monitoring manager to perform threshold detection on the virtual monitoring timer. The subtask execution unit clears the count value of the virtual monitoring timer once for each execution of the target service. If the subtask execution unit abnormally stops during service execution, the clearing of the count value will be stopped.
[0161] Before a subtask execution unit automatically enters a dormant state after completing its target business or is controlled to enter a dormant state by an external event, the virtual monitoring timer is disabled, and the status of the virtual monitoring timer is marked with a second identifier to trigger the monitoring manager to release the threshold detection of the virtual monitoring timer, that is, to release the operation monitoring of the subtask execution unit.
[0162] like Figure 10 The diagram shown illustrates the subtask monitoring process provided in this embodiment. The monitoring manager iterates through the status identifiers of the virtual monitoring timers in the virtual monitoring timer set at first time intervals, determining whether they are enabled. If the status identifier of a virtual monitoring timer is the first identifier (enabled), a threshold check is performed on that virtual monitoring timer. If the status identifier of a virtual monitoring timer is the second identifier (disabled), no threshold check is performed on that virtual monitoring timer.
[0163] The system detects the count value of the virtual monitoring timer with the first identifier. If the count value of any virtual monitoring timer is found to be greater than the registered second time threshold, the status data of the corresponding subtask execution unit is stored in memory. Then, a clear signal is sent to the system monitoring timer to reset its count value. A short timeout threshold switch is then performed, configuring the timeout trigger threshold T of the system monitoring timer to T1 (the third time threshold). Simultaneously, the first controller 251 is controlled to enter a sleep state T1+Δt, so that after time T1, the count value of the system monitoring timer is greater than T1, triggering the first controller 251 to restart.
[0164] If the count value of the virtual monitoring timer is detected to be less than or equal to the second time threshold, the timeout trigger threshold T of the system monitoring timer remains unchanged and is configured as T0 (initial time threshold), where T0 > T1. A clear signal is sent to the system monitoring timer to reset its count value. The count value of the virtual monitoring timers in the virtual monitoring timer set is then incremented by the first time interval. The above steps are repeated to achieve operational monitoring of the subtask execution unit.
[0165] In this embodiment, a virtual monitoring timer set is used to monitor the operation of subtasks. This provides finer-grained monitoring compared to the main application, compensating for the blind spots in the main application's awareness of subtask execution status. Flexible timeout thresholds are provided, dynamically enabling and disabling monitoring to meet the business execution needs of different subtasks. Furthermore, the number of monitored subtasks is not limited by the system's system monitoring timer resources. The unified control provided by the monitoring manager can output the execution data of abnormal subtasks for easier subsequent analysis. Triggering can be achieved through ultra-short-term threshold switching, enabling more timely and effective identification of abnormal subtasks.
[0166] Based on the above system monitoring method, some embodiments of this application also provide a display device 200, which includes a display 260, a first controller 251, and a second controller 252. The display 260 is configured to display a user interface. The first controller 251 runs a main application, which includes a monitoring manager and multiple subtask execution units. The second controller 252 runs a system monitoring timer. The first controller 251 is configured to:
[0167] In response to a wake-up command used to wake up a subtask execution unit, the virtual watchdog timer associated with the subtask execution unit is searched in the set of virtual watchdog timers.
[0168] Set the status flag of the virtual monitoring timer to the first flag, which is used to indicate that the subtask execution unit is in the running state.
[0169] The target service is executed through the subtask execution unit, and the count value of the virtual monitoring timer is cleared after the target service is completed.
[0170] At the first time threshold interval, the monitoring manager detects the count value of the virtual monitoring timers with the first status identifier in the set of virtual monitoring timers.
[0171] If the count value of the virtual monitoring timer is less than or equal to the second time threshold, a clear signal is sent to the second controller 252, and the count value of the virtual monitoring timer is increased by the first time threshold. The second time threshold is set based on the business processing time of the subtask execution unit.
[0172] If the count value of the virtual monitoring timer is greater than the second time threshold, a clear signal is not sent to the second controller 252.
[0173] The second controller 252 is configured as follows:
[0174] In response to the clear signal, reset the count value of the system monitoring timer.
[0175] When the count value of the system monitoring timer exceeds the third time threshold, a reset signal is sent to the first controller 251 to restart the first controller 251.
[0176] The same or similar parts among the various embodiments in this specification can be referred to mutually, and will not be repeated here.
[0177] As can be seen from the above technical solutions, the display device and system monitoring method provided in the above embodiments can, when a subtask execution unit enters the running state, search for the virtual monitoring timer associated with the subtask execution unit in the virtual monitoring timer set, execute the target service through the subtask execution unit, and clear the count value of the virtual monitoring timer after the target service is executed. Simultaneously, at intervals of a first time threshold, the monitoring manager can detect the count value of the virtual monitoring timers in the virtual monitoring timer set. If the count value is less than or equal to a second time threshold, a clear signal is sent to the system monitoring timer, and the count value is increased by the first time threshold. If the count value is greater than the second time threshold, no clear signal is sent to the system monitoring timer, so that the count value of the system monitoring timer exceeds a third time threshold, thereby triggering a system restart. The method realizes the operation monitoring of subtasks through the virtual monitoring timer set.
[0178] Those skilled in the art will clearly understand that the techniques in the embodiments of the present invention can be implemented using software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solutions in the embodiments of the present invention, or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of various embodiments or certain parts of the embodiments of the present invention.
[0179] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
[0180] For ease of explanation, the above description has been provided in conjunction with specific embodiments. However, the above exemplary discussion is not intended to be exhaustive or to limit the embodiments to the specific forms disclosed above. Various modifications and variations can be obtained based on the above teachings. The selection and description of the above embodiments are for the purpose of better explaining the principles and practical applications, thereby enabling those skilled in the art to better utilize the described embodiments and various different variations of embodiments suitable for specific use considerations.
Claims
1. A display device, characterized in that, include: The monitor is configured to display the user interface; A first controller is configured to run a main application, which includes a monitoring manager and multiple subtask execution units. The second controller is configured to run a system monitoring timer; The first controller is configured as follows: In response to a wake-up command for waking up the subtask execution unit, the virtual monitoring timer associated with the subtask execution unit is searched in the set of virtual monitoring timers; Set the status flag of the virtual monitoring timer to a first flag, the first flag being used to indicate that the subtask execution unit is in a running state; The target service is executed through the subtask execution unit, and the count value of the virtual monitoring timer is cleared after the target service is executed. At a first time threshold interval, the monitoring manager detects the count value of the virtual monitoring timer in the set of virtual monitoring timers whose status identifier is the first identifier; If the count value of the virtual monitoring timer is less than or equal to the second time threshold, a clear signal is sent to the second controller, and the count value of the virtual monitoring timer is increased by the first time threshold; the second time threshold is set based on the business processing time of the subtask execution unit. If the count value of the virtual monitoring timer is greater than the second time threshold, a clear signal is not sent to the second controller; The second controller is configured as follows: In response to the clear signal, the count value of the system monitoring timer is reset; When the count value of the system monitoring timer exceeds the third time threshold, a reset signal is sent to the first controller to restart the first controller.
2. The display device according to claim 1, characterized in that, Before the first controller performs the step of searching for the virtual monitoring timer associated with the subtask execution unit in the set of virtual monitoring timers, it is also configured to: Obtain the subtask identifier and second time threshold of the subtask execution unit; Obtain the set of virtual monitoring timers; In the set of virtual monitoring timers, a virtual monitoring timer is registered based on the subtask identifier and the second time threshold, and the virtual monitoring timer is a data structure object.
3. The display device according to claim 1, characterized in that, The first controller, in performing the step of acquiring the second time threshold, is further configured to: The business processing time of the subtask execution unit, the first time threshold, and the third time threshold are obtained; the business processing time is the average processing time of the subtask execution unit executing the target business multiple times; A second time threshold is calculated based on the business processing time, the first time threshold, and the third time threshold. The second time threshold is the product of the business processing time, the first time threshold, and the third time threshold.
4. The display device according to claim 1, characterized in that, The first controller is also configured to: In response to a sleep command for putting the subtask execution unit to sleep, the virtual monitoring timer associated with the subtask execution unit is searched in the set of virtual monitoring timers; The status flag of the virtual monitoring timer is set to a second flag, which is used to indicate that the subtask execution unit is in a sleep state.
5. The display device according to claim 4, characterized in that, The first controller is also configured to: Read the status identifier of the virtual monitoring timer in the set of virtual monitoring timers; If the status identifier of the virtual monitoring timer is the first identifier, then the count value of the virtual monitoring timer is detected; If the status identifier of the virtual monitoring timer is the second identifier, then the count value of the virtual monitoring timer is not detected.
6. The display device according to claim 1, characterized in that, It also includes memory, and if the count value of the virtual monitoring timer is greater than a second time threshold, the first controller is further configured to: Obtain the status data of the subtask execution unit; The state data is stored in the memory.
7. The display device according to claim 1, characterized in that, If the count value of the virtual monitoring timer is greater than the second time threshold, the first controller is further configured to: Send a clear signal to the second controller; Send a third time threshold to the second controller; The second controller is also configured to: In response to the clear signal, the count value of the system monitoring timer is reset; The system receives a third time threshold sent by the first controller and changes the initial time threshold of the system monitoring timer to the third time threshold, wherein the third time threshold is less than the initial time threshold.
8. The display device according to claim 7, characterized in that, If the count value of the virtual monitoring timer is greater than the second time threshold, the first controller is further configured to: A sleep period is set, wherein the sleep duration corresponding to the sleep period is greater than the third time threshold; Get the current time; If the current time is within the sleep period, no clear signal is sent to the system monitoring timer.
9. The display device according to claim 1, characterized in that, After the first controller performs the step of setting the status flag of the virtual monitoring timer to the first flag, it is further configured to: Execute the target business logic in a loop; Monitor the single execution completion event of the target service; In response to the detected single execution end event of the target service, the count value of the virtual monitoring timer is cleared.
10. A system monitoring method, characterized in that, Applied to a display device, the display device including a display, a first controller, and a second controller; the display is used to display a user interface; The first controller runs a main application, which includes a monitoring manager and multiple subtask execution units; The second controller runs a system monitoring timer; the method includes: In response to the wake-up command of the subtask execution unit, the first controller searches for the virtual monitoring timer associated with the subtask execution unit in the set of virtual monitoring timers; Set the status flag of the virtual monitoring timer to a first flag, the first flag being used to indicate that the subtask execution unit is in a running state; The target service is executed through the subtask execution unit, and the count value of the virtual monitoring timer is cleared after the target service is executed. At a first time threshold interval, the monitoring manager detects the count value of the virtual monitoring timer in the set of virtual monitoring timers whose status identifier is the first identifier; If the count value of the virtual monitoring timer is less than or equal to the second time threshold, a clear signal is sent to the second controller, and the count value of the virtual monitoring timer is increased by the first time threshold; the second time threshold is set based on the business processing time of the subtask execution unit. If the count value of the virtual monitoring timer is greater than the second time threshold, a clear signal is not sent to the second controller; In response to the clear signal, the second controller resets the count value of the system monitoring timer; When the count value of the system monitoring timer exceeds the third time threshold, a reset signal is sent to the first controller to restart the first controller.
Citation Information
Patent Citations
Periodic task reliability control method based on watchdog and timer
CN101216798A
Multitask monitoring management system
CN101464811A