CN115904297A - Screen display detection method, electronic device and storage medium - Google Patents

Screen display detection method, electronic device and storage medium Download PDF

Info

Publication number
CN115904297A
CN115904297A CN202110956799.1A CN202110956799A CN115904297A CN 115904297 A CN115904297 A CN 115904297A CN 202110956799 A CN202110956799 A CN 202110956799A CN 115904297 A CN115904297 A CN 115904297A
Authority
CN
China
Prior art keywords
display screen
screen
brightness
display
event
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110956799.1A
Other languages
Chinese (zh)
Inventor
郭晓杰
王震雨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202110956799.1A priority Critical patent/CN115904297A/en
Publication of CN115904297A publication Critical patent/CN115904297A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Control Of Indicators Other Than Cathode Ray Tubes (AREA)

Abstract

The application provides a screen display detection method, an electronic device and a storage medium, wherein the method comprises the following steps: acquiring a power supply event for controlling the screen on or off of the display screen through the kernel layer, and transmitting the power supply event to the frame layer; acquiring a power supply event through a framework layer, and judging whether the transmission of the power supply event is blocked in a kernel layer; if the power supply event is determined not to be blocked in the kernel layer, judging whether the power supply event is blocked in the framework layer; and if the power supply event is determined not to be blocked in the frame layer, controlling the display screen to be on or off through the inner core layer. The method and the device can determine whether the abnormal node is generated in the bright screen-out event processing process or not by detecting whether the bright screen-out event is blocked at each node, so that the reason that the screen cannot be normally bright or turned off is determined in time, the electronic equipment is helped to correct the bright screen-out abnormality in time, and the user experience is improved.

Description

Screen display detection method, electronic device and storage medium
Technical Field
The present application relates to the field of terminal technologies, and in particular, to a screen display detection method, an electronic device, and a storage medium.
Background
Intelligent electronic devices such as smart phones, tablet computers, wearable devices, and the like have been widely used in people's daily lives. In the process of using the electronic device, a user often needs to control the screen to be turned on or off by pressing a power key or clicking the screen, however, the electronic device sometimes cannot normally turn on or off the screen due to various reasons, and the reason why the screen cannot be normally turned on or off often cannot be determined in time, for example, it cannot be determined in time at which node the processing of turning on or off the screen is blocked, so that the normal use of the electronic device by the user is affected, and the user easily suspects the device failure, which leads to the public opinion of the user.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a screen display detection method, an electronic device and a storage medium to solve the problem that the reason why the screen cannot be turned on or off normally cannot be determined in time.
In a first aspect, the present application provides a method for detecting screen display, the method comprising: acquiring a power supply event for controlling the screen on or off of a display screen through an inner core layer, and transmitting the power supply event to a frame layer; acquiring the power supply event through the framework layer, and judging whether the transmission of the power supply event is blocked in the inner core layer; if the power supply event is determined not to be blocked in the inner core layer, judging whether the power supply event is blocked in the framework layer; and if the power supply event is determined not to be blocked in the frame layer, controlling the screen to be on or off through the inner core layer. By the technical scheme, whether the electronic equipment generates blockage at each node in the process of processing the screen-on or screen-off event can be determined, so that the reason that the screen cannot be normally turned on or off can be determined in time.
In a possible implementation manner, the acquiring, by the kernel layer, a power event for controlling the display screen to be turned on or off includes: and detecting whether a user performs screen on or screen off operation, and if the user performs the screen on or screen off operation, acquiring the power supply event. Through the technical scheme, the user operation can be accurately responded.
In one possible implementation, communicating the power event to a framework includes: after the power event is obtained, the kernel layer is accessed to a first overtime detection node, the first overtime detection node is controlled to count down based on first overtime, and the power event is transmitted to the framework layer. By the technical scheme, the transmission of the power supply event can be monitored based on countdown.
In one possible implementation, determining whether delivery of the power event is blocked at the core layer comprises: before the framework layer acquires a power event, judging whether countdown based on the first timeout time is finished; if the countdown based on the first overtime time is determined to be finished before the framework layer acquires the power supply event, determining that the power supply event is blocked in the kernel layer; or if the countdown based on the first timeout time does not end before the framework layer acquires the power event, determining that the transmission of the power event is not blocked in the kernel layer. By the technical scheme, whether the transmission of the power supply event is blocked or not can be accurately determined based on whether the countdown is finished or not.
In one possible implementation, the obtaining, by the framework layer, the power event includes: and the framework layer acquires the power supply event transmitted by the kernel layer through an open source event analysis platform and distributes the power supply event through an input event processing mechanism. The power supply event can be responded in time through the technical scheme.
In one possible implementation, the determining whether the power event is blocked at the framework layer comprises: after the framework layer acquires the power event, the framework layer is accessed to a second overtime detection node and controls the second overtime detection node to count down based on second overtime; acquiring the state of the display screen, and deciding whether the display screen needs to be turned on or off according to the state of the display screen; if the display screen needs to be subjected to screen lightening, sending a screen lightening instruction to the inner core layer; or if the screen is determined to need to be extinguished, sending a screen extinguishing instruction to the kernel layer; determining whether the power event is blocked at the chassis layer based on a countdown of the second timeout. By the technical scheme, whether the power supply event is blocked at the framework layer or not can be accurately determined based on whether the countdown is finished or not.
In one possible implementation, the determining whether the power event is blocked at the framework layer further comprises: and in the process that the second overtime detection node counts down based on the second overtime, sending heartbeat packets to the first overtime detection node at preset intervals so as to detect whether the second overtime detection node works normally or not in real time. By the technical scheme, analysis errors caused by the second overtime detection node fault can be avoided.
In one possible implementation, the state of the display screen includes a power state, and the power state includes on, off, and partially on. Through the technical scheme, whether the display screen needs to be turned on or turned off can be determined based on different power states.
In one possible implementation manner, the deciding whether the display screen needs to be turned on or off according to the state of the display screen includes: deciding whether the display screen needs to be turned on or off according to the power state of the display screen; if the power state of the display screen is closed or partially opened, determining that the user operation corresponding to the power event is a screen-lightening operation, and deciding that the display screen needs to be lightened; or if the power state of the display screen is on, determining that the user operation corresponding to the power event is a screen-off operation, and deciding that the screen-off of the display screen needs to be executed. Through the technical scheme, whether the display screen needs to be turned on or turned off can be accurately determined.
In a possible implementation manner, the state of the display screen further includes display screen driving brightness, and deciding whether the display screen needs to be turned on or off according to the state of the display screen includes: deciding whether the display screen needs to be turned on or off according to the power state of the display screen and the driving brightness of the display screen; if the power state of the display screen is started and the driving brightness of the display screen is smaller than a first threshold value, determining that the user operation corresponding to the power event is a screen lightening operation, and deciding that the display screen needs to be lightened; or if the power state of the display screen is on and the driving brightness of the display screen is greater than or equal to a first threshold, determining that the user operation corresponding to the power event is a screen-off operation, and deciding that the screen-off of the display screen needs to be executed; or if the power state of the display screen is off or partially on, determining that the user operation corresponding to the power event is a screen lightening operation, and deciding that the display screen needs to be lightened. Through the technical scheme, whether the display screen needs to be turned on or turned off can be accurately determined by combining with the actual brightness of the display screen.
In one possible implementation manner, deciding whether the display screen needs to be turned on or off according to the state of the display screen includes: according to the power state of the display screen, the driving brightness of the display screen and the action currently executed by the display screen, deciding whether the display screen needs to be turned on or turned off; if the power state of the display screen is turned on and the driving brightness of the display screen is smaller than a first threshold value, determining that the user operation corresponding to the power event is a screen-on operation, if the display screen is currently performing screen-on, deciding that the display screen does not need to perform screen-on or screen-off, if the display screen is currently performing screen-off, deciding that the display screen needs to perform screen-on, and if the display screen is not currently performing action, deciding that the display screen needs to perform screen-on; or if the power state of the display screen is on and the driving brightness of the display screen is greater than or equal to a first threshold, determining that the user operation corresponding to the power event is screen-off operation, if the display screen is currently executing screen-off, deciding that the display screen does not need to be turned on or off, if the display screen is currently executing screen-on, deciding that the display screen needs to be turned off, and if the display screen is not currently executing action, deciding that the display screen needs to be turned off; or if the power state of the display screen is closed or partially opened, determining that the user operation corresponding to the power event is a screen-on operation, if the display screen is currently performing screen-on, deciding that the display screen does not need to perform screen-on or screen-off, if the display screen is currently performing screen-off, deciding that the display screen needs to perform screen-on, and if the display screen is not currently performing action, deciding that the display screen needs to perform screen-on. According to the technical scheme, the screen turning-on or screen turning-off action which is executed by the display screen can be combined to accurately determine whether the display screen needs to be turned on or turned off.
In a possible implementation manner, deciding whether the display screen needs to be turned on or off according to the state of the display screen further includes: if the user operation corresponding to the power supply event is determined to be screen-on operation and the display screen is currently in screen-off execution, deciding that the display screen needs to be screen-on, and performing overtime monitoring for screen-off and overtime monitoring for increasing screen-on; or if the user operation corresponding to the power supply event is determined to be screen turn-off operation and the display screen is currently performing screen turn-on, deciding that the screen turn-off needs to be performed on the display screen, and canceling the overtime monitoring of screen turn-on and increasing the overtime monitoring of screen turn-off. By the technical scheme, the overtime monitoring mode can be changed when the display screen is switched to be on or off.
In one possible implementation, determining whether the power event is blocked at the framework layer based on the countdown of the second timeout time includes; when the screen lightening instruction or the screen extinguishing instruction is sent to the kernel layer, whether countdown of the second overtime time is finished or not is judged; if the countdown of the second timeout period is not finished, determining that the power event is not blocked in the framework layer; or if the countdown of the second timeout period is over, determining that the power event is blocked at the framework layer. By the technical scheme, the blockage of the power supply event in the framework layer can be accurately analyzed based on countdown.
In one possible implementation, the determining whether the power event is blocked at the framework layer further includes: if the display screen needs to be subjected to screen lightening, acquiring the brightness of the display screen to be set of the frame layer, and judging whether the brightness of the display screen to be set is effective or not; if the brightness of the display screen to be set is determined to be invalid, the brightness of the display screen to be set is determined again until the brightness of the display screen to be set is valid; or if the brightness of the display screen to be set is determined to be effective, judging whether the display screen finishes window drawing; and if the display screen finishes window drawing, calling a driving interface to set the brightness of the display screen to be set, and transmitting the set brightness of the display screen to the kernel layer. According to the technical scheme, whether the screen is normally bright can be determined by determining whether the brightness of the display screen is normal.
In one possible implementation manner, the determining whether the brightness of the display screen to be set is effective includes: judging whether the percentage of the brightness of the display screen to be set to the maximum brightness of the display screen is larger than or equal to a second threshold value or not; if the percentage of the brightness of the display screen to be set to the maximum brightness of the display screen is larger than or equal to the second threshold value, determining that the brightness of the display screen to be set is effective; or if the percentage of the brightness of the display screen to be set to the maximum brightness of the display screen is smaller than the second threshold value, determining that the brightness of the display screen to be set is invalid. Whether the brightness of the display screen is normal or not can be accurately determined through the technical scheme.
In one possible implementation, the method further includes: the kernel layer receives the set display screen brightness, a display screen driving interface is called to set the display screen brightness, and whether the actual display brightness of the display screen is consistent with the set display screen brightness or not is judged when the display screen is bright; if the fact that the actual display brightness of the display screen does not accord with the set display screen brightness is determined, the display screen driving interface is used for driving the display screen to be bright again according to the set display screen brightness until the actual display brightness of the display screen accords with the set display screen brightness; and judging whether the brightness setting of the display screen is blocked in the inner core layer. Through the technical scheme, the display screen can be reset when the brightness of the display screen is abnormal.
In one possible implementation, the method further includes: after receiving the brightness of the display screen, the kernel layer accesses the first overtime detection node and controls the first overtime detection node to count down based on third overtime; determining whether a display screen brightness setting is blocked at the kernel layer comprises: when the actual display brightness of the display screen is determined to be consistent with the set display screen brightness, judging whether the countdown of the third overtime time is finished; if the countdown of the third overtime time is determined to be finished, determining that the brightness of the display screen is set to be blocked in the kernel layer; or if the countdown of the third timeout time is not determined to be finished, determining that the brightness setting of the display screen is not blocked in the kernel layer. By the technical scheme, whether the brightness setting of the display screen is blocked in the kernel layer or not can be accurately analyzed based on countdown.
In one possible implementation, the method further includes: and if the power supply event is determined to be blocked in the inner core layer, or the power supply event is determined to be blocked in the frame layer, or the brightness of the display screen is determined to be set to be blocked in the inner core layer, determining that the display screen is abnormally turned on or turned off. According to the technical scheme, the abnormal screen on or off of the display screen can be determined based on the process of power supply event blocking.
In one possible implementation, the method further includes: and acquiring the abnormal event to generate a log, and uploading the log to a server. By the technical scheme, the logs can be uploaded in time when the display screen is turned on or turned off abnormally, and the user can analyze the logs conveniently.
In one possible implementation, obtaining the exception event to generate the log includes: and when the brightness detection is abnormal or the screen on/off event processing is blocked, acquiring the abnormal event according to a preset rule to generate the log. By the technical scheme, the log can be generated in the abnormal process of the screen on/off event processing.
In a possible implementation manner, the obtaining the abnormal event according to a preset rule includes: obtaining the maintenance and measurement information of the abnormal event according to a preset privacy rule, and writing the abnormal event and the corresponding abnormal information into an abnormal node or path, wherein the maintenance and measurement information comprises call stack information and additional information, and the preset privacy rule comprises: the acquired call stack information and the additional information do not contain privacy information of the user. By the technical scheme, abnormal events can be analyzed conveniently, and privacy safety of users can be guaranteed.
In a second aspect, the present application provides an electronic device comprising a memory and a processor:
wherein the memory is configured to store program instructions;
the processor is used for reading and executing the program instructions stored in the memory, and when the program instructions are executed by the processor, the electronic equipment is enabled to execute the screen display detection method.
In a third aspect, the present application provides a computer storage medium storing program instructions that, when run on an electronic device, cause the electronic device to perform the above screen display detection method.
In addition, the technical effects brought by the second aspect to the third aspect can be referred to the description related to the methods designed in the above methods, and are not repeated herein.
The screen display detection method, the electronic equipment and the storage medium can determine the abnormal nodes generated in the processing process of the screen brightening and blanking event by detecting whether the screen brightening and blanking event is blocked at each node or not, thereby timely determining the reasons that the screen can not be normally brightened or blanked, being beneficial to timely correcting the screen brightening and blanking abnormality of the electronic equipment, improving the user experience and avoiding the public opinion of users.
Drawings
Fig. 1 is a schematic view of an electronic device in a screen-off state.
Fig. 2 is a schematic diagram of the electronic device in a bright screen state.
Fig. 3 is a hardware architecture diagram of an electronic device according to an embodiment of the present application.
Fig. 4 is a software architecture diagram of an electronic device according to an embodiment of the present application.
Fig. 5 is a flowchart of a screen display detection method according to an embodiment of the present application.
Fig. 6 is a flowchart of determining whether a power event is blocked at a framework layer according to an embodiment of the present application.
Fig. 7 is a flowchart of a screen display detection method according to another embodiment of the present application.
FIG. 8 is a flowchart of a method for determining whether a power event is blocked at a framework layer according to another embodiment of the present application.
Fig. 9 is a schematic view of a bright screen application scene of a screen display detection method according to an embodiment of the present application.
10A-10B are flow diagrams of a method for detecting screen display according to another embodiment of the present application.
Fig. 11 is a schematic view of a screen-off application scene of a screen display detection method according to an embodiment of the present application.
Fig. 12 is a flowchart of a screen display detection method according to another embodiment of the present application.
Fig. 13 is a schematic view of a communication architecture of an electronic device according to an embodiment of the present application.
Fig. 14 is a schematic view of a flow monitoring logic of a screen display detection method according to an embodiment of the present application.
Detailed Description
For ease of understanding, some descriptions of concepts related to the embodiments of the present application are given by way of illustration and for reference.
It should be noted that the terms "first" and "second" referred to in the embodiments of the present application are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implying any number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or illustrations. Any embodiment or design described herein as "exemplary" or "such as" is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the word "exemplary" or "such as" is intended to present concepts related in a concrete fashion.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the description of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. It should be understood that in this application, "/" means "or" means "unless otherwise indicated. For example, A/B may represent A or B. In the present application, "and/or" is only one kind of association relation describing an associated object, and means that three kinds of relations may exist. For example, a and/or B, may represent: a exists alone, A and B exist simultaneously, and B exists alone. "at least one" means one or more. "plurality" means two or more than two. For example, at least one of a, b, or c, may represent: a, b, c, a and b, a and c, b and c, a, b and c.
In order to better understand the screen display detection method and the electronic device provided in the embodiment of the present application, an application scenario of the screen display detection method of the present application is first described below.
Fig. 1 is a schematic view illustrating a screen-off state of an electronic device. Taking actual user experience as an example, when the electronic device is in the screen-off state, the user may perform a screen-on operation on the electronic device to control the electronic device to turn on the screen. The screen-on operation may be touching a display screen of the electronic device, pressing a power key of the electronic device, or lifting the electronic device, or may be other preset operations. However, the electronic device may not be normally lit for various reasons.
Fig. 2 is a schematic view illustrating the electronic device in a bright state. Taking actual user experience as an example, when the electronic device is in a bright screen state, the user may perform a screen-off operation on the electronic device to control the electronic device to turn off the screen. The screen-off operation can be touching a display screen of the electronic device, pressing a power key of the electronic device or putting down the electronic device, and can also be other preset operations. However, the electronic device may not normally be off for various reasons.
The above event that the electronic device is not normally turned on or off is a very common problem in the public sentiment of the user, and the user usually considers that the electronic device fails, even asks about the quality of the electronic device, so that inconvenience in using the electronic device is brought to the user, and the user is easily lost. The scenes that the electronic equipment is not normally on or off comprise the scenes of event transmission blockage in a kernel state or a user state, abnormal foreground window drawing, unreasonable brightness value setting and the like. The event of the kernel state may include the transmission of a screen-on event or a screen-off event. The event of the user state may include an input event, a display screen brightness value delivery event, and the like. In the process of performing screen on or screen off by the electronic device, if the process is blocked, the process can be generally optimized by triggering the anr/watchdog program, however, the triggering probability of the anr/watchdog is low, and the triggering of the watchdog easily causes the electronic device to restart, thereby causing inconvenience to the user.
In order to solve the technical problem that the electronic device is not normally turned on or off, an embodiment of the application provides a screen display detection method. The method is applied in the electronic device 100. Referring to fig. 3, the electronic device 100 may be a mobile phone, a tablet Computer, a desktop Computer, a laptop Computer, a handheld Computer, a notebook Computer, an Ultra-mobile Personal Computer (UMPC), a netbook, a cellular phone, a Personal Digital Assistant (PDA), an Augmented Reality (AR) device, a Virtual Reality (VR) device, an Artificial Intelligence (AI) device, a wearable device, a vehicle-mounted device, a smart home device, and/or a city device, and the embodiment of the present application does not particularly limit the specific type of the electronic device 100.
The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a Universal Serial Bus (USB) interface 130, a charging management Module 140, a power management Module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication Module 150, a wireless communication Module 160, an audio Module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor Module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, a Subscriber Identity Module (SIM) card interface 195, and the like. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
It is to be understood that the illustrated structure of the embodiment of the present invention does not specifically limit the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or combine certain components, or split certain components, or arrange different components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Processor 110 may include one or more processing units, such as: the Processor 110 may include an Application Processor (AP), a modem Processor, a Graphics Processing Unit (GPU), an Image Signal Processor (ISP), a controller, a video codec, a Digital Signal Processor (DSP), a baseband Processor, and/or a Neural-Network Processing Unit (NPU), among others. Wherein, the different processing units may be independent devices or may be integrated in one or more processors.
The controller can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of instruction fetching and instruction execution.
A memory may also be provided in processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Avoiding repeated accesses reduces the latency of the processor 110, thereby increasing the efficiency of the system.
In some embodiments, processor 110 may include one or more interfaces. The Interface may include an integrated Circuit (I2C) Interface, an Inter-integrated Circuit Sound (I2S) Interface, a Pulse Code Modulation (PCM) Interface, a Universal asynchronous receiver/transmitter (UART) Interface, a Mobile Industry Processor Interface (MIPI), a General-Purpose Input/Output (GPIO) Interface, a Subscriber Identity Module (SIM) Interface, and/or a Universal Serial Bus (USB) Interface, etc.
The I2C interface is a bidirectional synchronous Serial bus including a Serial Data Line (SDA) and a Serial Clock Line (SCL). In some embodiments, processor 110 may include multiple sets of I2C buses. The processor 110 may be coupled to the touch sensor 180K, a charger, a flash, a camera 193, etc. through different I2C bus interfaces, respectively. For example: the processor 110 may be coupled to the touch sensor 180K through an I2C interface, so that the processor 110 and the touch sensor 180K communicate through an I2C bus interface to implement a touch function of the electronic device 100.
The I2S interface may be used for audio communication. In some embodiments, processor 110 may include multiple sets of I2S buses. The processor 110 may be coupled to the audio module 170 through an I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 may transmit an audio signal to the wireless communication module 160 through the I2S interface, so as to implement a function of answering a call through a bluetooth headset.
The PCM interface may also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 may be coupled by a PCM bus interface. In some embodiments, the audio module 170 may also transmit audio signals to the wireless communication module 160 through the PCM interface, so as to implement a function of answering a call through a bluetooth headset. Both the I2S interface and the PCM interface may be used for audio communication.
The UART interface is a universal serial data bus used for asynchronous communications. The bus may be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, a UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example: the processor 110 communicates with a bluetooth module in the wireless communication module 160 through a UART interface to implement a bluetooth function. In some embodiments, the audio module 170 may transmit the audio signal to the wireless communication module 160 through a UART interface, so as to realize the function of playing music through a bluetooth headset.
MIPI interfaces may be used to connect processor 110 with peripheral devices such as display screen 194, camera 193, and the like. The MIPI Interface includes a Camera Serial Interface (CSI), a Display Serial Interface (DSI), and the like. In some embodiments, processor 110 and camera 193 communicate through a CSI interface to implement the capture functionality of electronic device 100. Processor 110 and display screen 194 communicate via a DSI interface to implement display functions of electronic device 100.
The GPIO interface may be configured by software. The GPIO interface may be configured as a control signal and may also be configured as a data signal. In some embodiments, a GPIO interface may be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, and the like. The GPIO interface may also be configured as an I2C interface, I2S interface, UART interface, MIPI interface, and the like.
The USB interface 130 is an interface conforming to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 may be used to connect a charger to charge the electronic device 100, and may also be used to transmit data between the electronic device 100 and a peripheral device. And the earphone can also be used for connecting an earphone and playing audio through the earphone. The interface may also be used to connect other electronic devices 100, such as AR devices and the like.
It should be understood that the connection relationship between the modules according to the embodiment of the present invention is only illustrative and is not limited to the structure of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection manners or a combination of multiple interface connection manners in the above embodiments.
The charging management module 140 is configured to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive a wireless charging input through a wireless charging coil of the electronic device 100. The charging management module 140 may also supply power to the electronic device 100 through the power management module 141 while charging the battery 142.
The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140, and supplies power to the processor 110, the internal memory 121, the display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 may also be used to monitor parameters such as battery capacity, battery cycle count, battery state of health (leakage, impedance), etc. In some other embodiments, the power management module 141 may also be disposed in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may also be disposed in the same device.
The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 may be used to cover a single or multiple communication bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution including 2G/3G/4G/5G wireless communication applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power Amplifier, a Low Noise Amplifier (LNA), and the like. The mobile communication module 150 may receive the electromagnetic wave from the antenna 1, filter, amplify, etc. the received electromagnetic wave, and transmit the electromagnetic wave to the modem processor for demodulation. The mobile communication module 150 may also amplify the signal modulated by the modem processor, and convert the signal into electromagnetic wave through the antenna 1 to radiate the electromagnetic wave. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the same device as at least some of the modules of the processor 110.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then passes the demodulated low frequency baseband signal to a baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be provided in the same device as the mobile communication module 150 or other functional modules, independent of the processor 110.
The Wireless Communication module 160 may provide solutions for Wireless Communication applied to the electronic device 100, including Wireless Local Area Networks (WLANs) (e.g., wireless Fidelity (Wi-Fi) network), bluetooth (BT), global Navigation Satellite System (GNSS), frequency Modulation (FM), near Field Communication (NFC), infrared (IR), and the like. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, perform frequency modulation and amplification on the signal, and convert the signal into electromagnetic waves through the antenna 2 to radiate the electromagnetic waves.
In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150 and antenna 2 is coupled to wireless communication module 160 so that electronic device 100 can communicate with networks and other devices through wireless communication techniques. The wireless communication technology may include Global System For Mobile Communications (GSM), general Packet Radio Service (GPRS), code Division Multiple Access (CDMA), wideband Code Division Multiple Access (WCDMA), time Division Code Division Multiple Access (Time-Division Code Division Multiple Access, TD-SCDMA), long Term Evolution (Long Term Evolution, LTE), BT, GNSS, WLAN, NFC, FM, and/or IR technologies, etc. The GNSS may include a Global Positioning System (GPS), a Global Navigation Satellite System (GLONASS), a Beidou Navigation Satellite System (BDS), a Quasi-Zenith Satellite System (QZSS), and/or a Satellite Based Augmentation System (SBAS).
The electronic device 100 implements display functions via the GPU, the display screen 194, and the application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and an application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
The display screen 194 is used to display images, video, and the like. The display screen 194 includes a display panel. The Display panel may be a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), an Active Matrix Organic Light-Emitting Diode (Active-Matrix Organic Light-Emitting Diode, AMOLED), a flexible Light-Emitting Diode (FLED), a miniature, a Micro-OLED, a Quantum Dot Light-Emitting Diode (QLED), or the like. In some embodiments, the electronic device 100 may include 1 or N display screens 194, N being a positive integer greater than 1.
The electronic device 100 may implement a shooting function through the ISP, the camera 193, the video codec, the GPU, the display 194, the application processor, and the like.
The ISP is used to process the data fed back by the camera 193. For example, when a photo is taken, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converting into an image visible to naked eyes. The ISP can also carry out algorithm optimization on the noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in camera 193.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image to the photosensitive element. The photosensitive element may be a Charge Coupled Device (CCD) or a Complementary Metal-Oxide-Semiconductor (CMOS) phototransistor. The light sensing element converts the optical signal into an electrical signal, which is then passed to the ISP where it is converted into a digital image signal. And the ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into image signal in standard RGB, YUV and other formats. In some embodiments, electronic device 100 may include 1 or N cameras 193, N being a positive integer greater than 1.
The digital signal processor is used for processing digital signals, and can process digital image signals and other digital signals. For example, when the electronic device 100 selects a frequency bin, the digital signal processor is used to perform fourier transform or the like on the frequency bin energy.
Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 may play or record video in a variety of encoding formats, such as: moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, and the like.
The NPU is a Neural-Network (NN) computing processor, which processes input information quickly by using a biological Neural Network structure, for example, by using a transfer mode between neurons of a human brain, and can also learn by itself continuously. Applications such as intelligent recognition of the electronic device 100 can be realized through the NPU, for example: image recognition, face recognition, speech recognition, text understanding, and the like.
The internal Memory 121 may include one or more Random Access Memories (RAMs) and one or more Non-Volatile memories (NVMs).
The Random Access Memory may include Static Random-Access Memory (SRAM), dynamic Random-Access Memory (DRAM), synchronous Dynamic Random-Access Memory (SDRAM), double Data Rate SDRAM (DDR SDRAM), such as fifth generation DDR SDRAM generally referred to as DDR5 SDRAM), and the like;
the nonvolatile memory may include a magnetic disk storage device, a flash memory (flash memory).
The FLASH memory may include NOR FLASH, NAND FLASH, 3DNAND FLASH, etc. according to the operation principle, may include Single-Level Cell (SLC), multi-Level Cell (MLC), triple-Level Cell (TLC), four-Level Cell (QLC), etc. according to the Level order of the memory Cell, and may include Universal FLASH memory (UFS), embedded multimedia memory Card (mc), etc. according to the Storage specification.
The random access memory may be read directly by the processor 110, may be used to store executable programs (e.g., machine instructions) for an operating system or other programs that are running, and may also be used to store data for user and application programs, etc.
The nonvolatile memory may also store executable programs, data of users and application programs, and the like, and may be loaded into the random access memory in advance for the processor 110 to directly read and write.
The external memory interface 120 may be used to connect an external nonvolatile memory, so as to expand the storage capability of the electronic device 100. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to implement data storage functions. For example, files such as music, video, etc. are saved in an external nonvolatile memory.
The internal memory 121 or the external memory interface 120 is used to store one or more computer programs. One or more computer programs are configured to be executed by the processor 110. The one or more computer programs include a plurality of instructions that, when executed by the processor 110, may implement the screen display detection method performed on the electronic device 100 in the above-described embodiments to implement the screen display detection function of the electronic device 100.
The electronic device 100 may implement audio functions via the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D, and the application processor. Such as music playing, recording, etc.
The audio module 170 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be disposed in the processor 110, or some functional modules of the audio module 170 may be disposed in the processor 110.
The speaker 170A, also called a "horn", is used to convert the audio electrical signal into a sound signal. The electronic apparatus 100 can listen to music through the speaker 170A or listen to a hands-free call.
The receiver 170B, also called "earpiece", is used to convert the electrical audio signal into a sound signal. When the electronic apparatus 100 receives a call or voice information, it can receive voice by placing the receiver 170B close to the ear of the person.
The microphone 170C, also referred to as a "microphone," is used to convert sound signals into electrical signals. When making a call or sending voice information, the user can input a voice signal to the microphone 170C by uttering a voice signal close to the microphone 170C through the mouth of the user. The electronic device 100 may be provided with at least one microphone 170C. In other embodiments, the electronic device 100 may be provided with two microphones 170C to achieve a noise reduction function in addition to collecting sound signals. In other embodiments, the electronic device 100 may further include three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, and perform directional recording.
The earphone interface 170D is used to connect a wired earphone. The headset interface 170D may be the USB interface 130, or may be a 3.5mm Open Mobile electronic device 100 Platform (OMTP) standard interface, a Cellular Telecommunications Industry Association of america (CTIA) standard interface.
The keys 190 include a power-on key, a volume key, and the like. The keys 190 may be mechanical keys. Or may be touch keys. The electronic apparatus 100 may receive a key input, and generate a key signal input related to user setting and function control of the electronic apparatus 100.
The motor 191 may generate a vibration cue. The motor 191 may be used for incoming call vibration cues, as well as for touch vibration feedback. For example, touch operations applied to different applications (e.g., photographing, audio playing, etc.) may correspond to different vibration feedback effects. The motor 191 may also respond to different vibration feedback effects for touch operations applied to different areas of the display screen 194. Different application scenes (such as time reminding, receiving information, alarm clock, game and the like) can also correspond to different vibration feedback effects. The touch vibration feedback effect may also support customization.
Indicator 192 may be an indicator light that may be used to indicate a state of charge, a change in charge, or a message, missed call, notification, etc.
The SIM card interface 195 is used to connect a SIM card. The SIM card can be brought into and out of contact with the electronic apparatus 100 by being inserted into the SIM card interface 195 or being pulled out of the SIM card interface 195. The electronic device 100 may support 1 or N SIM card interfaces, N being a positive integer greater than 1. The SIM card interface 195 may support a Nano SIM card, a Micro SIM card, a SIM card, etc. The same SIM card interface 195 can be inserted with multiple cards at the same time. The types of the plurality of cards may be the same or different. The SIM card interface 195 is also compatible with different types of SIM cards. The SIM card interface 195 may also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as communication and data communication. In some embodiments, the electronic device 100 employs esims, namely: an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
Fig. 4 is a block diagram of a software structure of the electronic device 100 according to the embodiment of the present disclosure. The layered architecture divides the software into several layers, each layer having a clear role and division of labor. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into four layers, from top to bottom, an application layer, a framework layer, an Android runtime (Android runtime) and system library, and a kernel layer.
The application layer may include a series of application packages. For example, the application package may include camera, gallery, calendar, phone, map, navigation, WLAN, bluetooth, music, video, short message, etc. applications.
The framework layer provides an Application Programming Interface (API) and a Programming framework for the Application programs of the Application layer. The application framework layer includes a number of predefined functions. For example, the application framework layer may include a window manager, content provider, view system, phone manager, resource manager, notification manager, and the like.
Wherein, the window manager is used for managing the window program. The window manager can obtain the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like. The content provider is used to store and retrieve data and make it accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone books, etc. The view system includes visual controls such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, the display interface including the short message notification icon may include a view for displaying text and a view for displaying pictures. The phone manager is used to provide communication functions of the electronic device 100. Such as management of call status (including on, off, etc.). The resource manager provides various resources, such as localized strings, icons, pictures, layout files, video files, etc., to the application. The notification manager enables the application to display notification information in the status bar, can be used to convey notification-type messages, can disappear automatically after a brief dwell, and does not require user interaction. Such as a notification manager used to inform download completion, message alerts, etc. The notification manager may also be a notification that appears in the form of a chart or scroll bar text at the top status bar of the system, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialog window. For example, prompting text information in the status bar, sounding a prompt tone, vibrating the electronic device, flashing an indicator light, etc.
The Android Runtime comprises a core library and a virtual machine. The Android runtime is responsible for scheduling and managing an Android system. The core library comprises two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the framework layer run in a virtual machine. And executing java files of the application program layer and the framework layer into binary files by the virtual machine. The virtual machine is used for performing the functions of object life cycle management, stack management, thread management, safety and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. Such as surface managers (surface managers), media Libraries (Media Libraries), three-dimensional graphics processing Libraries (e.g., openGL ES), 2D graphics engines (e.g., SGL), and the like.
Wherein the surface manager is used for managing the display subsystem and providing the fusion of the 2D and 3D layers for a plurality of application programs. The media library supports a variety of commonly used audio, video format playback and recording, and still image files, among others. The media library may support a variety of audio-video encoding formats such as MPEG4, h.264, MP3, AAC, AMR, JPG, PNG, etc. The three-dimensional graphic processing library is used for realizing three-dimensional graphic drawing, image rendering, synthesis, layer processing and the like. The 2D graphics engine is a drawing engine for 2D drawing.
The kernel layer is a layer between hardware and software. The inner core layer at least comprises a display driver, a camera driver, an audio driver and a sensor driver.
The kernel layer is a core of an operating system of the electronic device 100, is a first layer of software extension based on hardware, provides the most basic functions of the operating system, is a basis for the operation of the operating system, is responsible for managing processes, memories, device drivers, files and a network system of the system, and determines the performance and stability of the system. For example, the kernel may determine the operation time of an application on a certain portion of hardware.
The kernel layer includes programs closely related to hardware, such as interrupt handlers, device drivers, etc., as well as basic, common, higher-frequency-of-operation modules, such as clock management modules, process scheduling modules, etc., and critical data structures. The kernel layer may be provided in the processor 110 or may be solidified in the internal memory 121.
Fig. 5 is a flowchart of a screen display detection method according to an embodiment of the present disclosure. The method is applied to the electronic device 100, and specifically comprises the following steps:
s501, acquiring a power supply event through the kernel layer, and transmitting the power supply event to the framework layer.
In an embodiment of the present application, acquiring the power event through the kernel layer includes: and detecting whether a user performs screen on or screen off operation, and if yes, acquiring a power supply event. Specifically, the power event is obtained through the/dev/input program. In one embodiment of the present application, the on or off operation is to trigger a power key. The power key may be a key (e.g., key 190) or may be a key separately provided, for example, a physical key or a virtual key. In other embodiments, the screen-on or screen-off operation is to trigger the display screen, that is, acquiring the power event through the kernel layer includes: whether a user triggers a display screen (e.g., the display screen 194) is detected, and if the user triggers the display screen, a power event is acquired. In particular, a user may trigger on-screen or off-screen control of the display screen by touching the display screen. In other embodiments, the on-screen operation is the user lifting the electronic device and the off-screen operation is the user dropping the electronic device.
In an embodiment of the present application, passing the power event to the framework layer includes: and after the power event is acquired, accessing a first overtime detection node, counting down based on the first overtime, and transmitting the power event to the framework layer. Specifically, after a power supply event is acquired, the current time s1 is acquired, and the first timeout detection node is accessed through the kernel driver. The first timeout time may be a preset time, or may be a time set when the electronic device first acquires a power event. The first timeout time may be set according to requirements, and optionally, the first timeout time is 0.5 ms.
In an embodiment of the application, the first timeout detecting node is a KHD timeout detecting node, belongs to a kernel node, monitors a task based on a KxxHxxDxx timeout mechanism, and monitors whether the task is completed within a specified time, and the completed task is removed.
S502, obtaining the power supply event through the framework layer, and judging whether the transmission of the power supply event is blocked in the kernel layer.
In an embodiment of the present application, acquiring the power event through the framework layer includes: the framework layer obtains the power supply event transmitted by the kernel layer through an EventHub (open source event analysis platform), and distributes the power supply event through an inputDispatcher (input event processing mechanism).
In an embodiment of the present application, determining whether the delivery of the power event is blocked at the kernel layer includes: before the framework layer acquires the power event, whether countdown based on the first timeout is finished is judged. If the countdown based on the first timeout period ends before the framework layer acquires the power event, it is determined that the delivery of the power event is blocked in the kernel layer, and then S505 is performed. If the countdown based on the first timeout period is not finished before the framework layer acquires the power event, it is determined that the delivery of the power event is not blocked at the kernel layer, and then S503 is performed. It is to be appreciated that if the countdown based on the first timeout period ends before the framework layer acquires the power event, indicating that the time for the kernel layer to deliver the power event to the framework layer exceeds the first timeout period, then a determination may be made that delivery of the power event is blocked at the kernel layer.
In other embodiments, determining whether the delivery of the power event is blocked at the core layer comprises: when the frame layer acquires the power supply event, the current time s2 is acquired, and the difference between the current time s2 and the current time s1 is determined. If the difference between the current time S2 and the current time S1 is greater than the first timeout time, it is determined that the delivery of the power event is blocked at the kernel layer, and then S505 is performed. If the difference between the current time S2 and the current time S1 is less than or equal to the first timeout time, it is determined that the delivery of the power event is not blocked at the kernel layer, and then S503 is performed. It is to be understood that if the difference between the current time s2 and the current time s1 is greater than the first timeout time, indicating that the time for the kernel layer to deliver the power event to the framework layer exceeds the first timeout time, it may be determined that the delivery of the power event is blocked at the kernel layer.
S503, judging whether the power supply event is blocked in the frame layer.
To more clearly and completely illustrate the determination of whether the power event is blocked at the framework layer, referring to the detailed flowchart of S503 shown in fig. 6, the determination of whether the power event is blocked at the framework layer includes:
s5031, after the power event is obtained at the framework layer, canceling timing of the first timeout detection node, accessing the second timeout detection node, and counting down based on the second timeout time. In an embodiment of the present application, the second timeout detecting node is an AHD timeout detecting node, belongs to a system service node in a framework layer, and monitors a task based on an FxxHxxDxx timeout mechanism, and monitors whether the task is completed within a specified time, where the completed task is removed.
In an embodiment of the application, the second timeout time may be a preset time, or may be a time set when the electronic device first determines whether the power event is blocked in the framework layer. The second timeout time may be set according to requirements, and optionally, the second timeout time is 1 millisecond.
In an embodiment of the application, in a process that the second timeout detection node performs countdown based on the second timeout time, a heartbeat packet is sent to the first timeout detection node every other preset time, and whether the second timeout detection node works normally or not is detected in real time through a heartbeat mechanism. And if the first overtime detection node does not receive the heartbeat packet in the countdown process of the second overtime, confirming that the second overtime detection node has a fault. The preset time can be set according to requirements, and optionally, the preset time is 0.05 milliseconds. The heartbeat packet is a self-defined command word which informs the state of the self-side to the opposite side at regular time.
S5032, a state of the display screen (e.g., display screen 194) is obtained. In an embodiment of the present application, the states of the display screen include, but are not limited to, a power state, a display screen setting brightness, and a display screen driving brightness. Power states include, but are not limited to, on (ScreenOn), off (ScreenOff), and partially On (AOD). It should be noted that the power state is turned on, that is, the display screen is completely lit, the power state is turned off, that is, the display screen is completely extinguished, and that the partially turned on power state is the screen which is lit in a partial area of the display screen, for example, a time display area, a background display area, an electric quantity display area, a signal display area, an operator display area and/or a preset display area of the display screen, and other display areas are still extinguished, that is, still in the extinguished state. The display screen setting brightness is the brightness set by the frame layer, and the display screen driving brightness is the actual display brightness of the display screen.
S5033, whether the display screen needs to be turned on or off is determined. In an embodiment of the application, whether the display screen needs to be turned on or off is determined according to the power state of the display screen. Specifically, if the power state of the display screen is off or partially on, that is, the display screen is in a screen-off state or a partial screen-off state, when the distributed power event is received, it is determined that the user operation corresponding to the power event is a screen-on operation, and then it is determined that the screen-on of the display screen needs to be executed. If the power state of the display screen is on, namely the display screen is in a bright screen state, when the distributed power event is received, determining that the user operation corresponding to the power event is a screen-off operation, and further deciding that the screen-off operation needs to be executed on the display screen.
In another embodiment of the application, whether the display screen needs to be turned on or off is determined according to the power state of the display screen and the driving brightness of the display screen. Specifically, if the power state of the display screen is on, that is, the display screen is in a bright screen state, and the driving brightness of the display screen is smaller than a first threshold, it indicates that the actual display brightness of the display screen is too low, and when a distributed power event is received, it is determined that the user operation corresponding to the power event is a bright screen operation, and then it is decided that the display screen needs to be bright. If the power state of the display screen is on, namely the display screen is in a bright screen state, and the driving brightness of the display screen is greater than or equal to a first threshold value, the display brightness of the display screen is high, when a distributed power event is received, the user operation corresponding to the power event is determined to be screen-off operation, and then the fact that the screen-off of the display screen needs to be executed is determined. If the power state of the display screen is off or partially on, namely the display screen is in a screen-off state or a partial screen-off state, when the distributed power event is received, determining that the user operation corresponding to the power event is a screen-on operation, and further deciding that the display screen needs to be subjected to screen-on. The first threshold may be set according to requirements, and optionally, the first threshold is 100nit (nit) or 50nit.
In another embodiment of the application, whether the display screen needs to be turned on or off is determined according to the power state of the display screen, the driving brightness of the display screen and the action currently being executed by the display screen. Specifically, if the power state of the display screen is on, that is, the display screen is in a screen-on state, and the driving brightness of the display screen is smaller than a first threshold value, it indicates that the display brightness of the display screen is too low, when a distributed power event is received, it is determined that the user operation corresponding to the power event is a screen-on operation, if the display screen is currently performing screen-on, the decision-making display screen does not need to perform screen-on or screen-off, if the display screen is currently performing screen-off, the decision-making display screen needs to perform screen-on, and overtime monitoring for eliminating the screen and overtime monitoring for increasing the screen-on are taken, and if the display screen is not currently performing an action, the decision-making display screen needs to perform screen-on. And if the decision display screen does not need to be turned on or off, ending the process.
Specifically, if the power state of the display screen is on, that is, the display screen is in a bright screen state, and the driving brightness of the display screen is greater than or equal to a first threshold, it indicates that the display brightness of the display screen is high, when a distributed power event is received, it is determined that a user operation corresponding to the power event is a screen-off operation, if the display screen is currently performing screen-off, a decision-making display screen does not need to perform screen-on or screen-off, if the display screen is currently performing screen-on, the decision-making display screen needs to perform screen-off, and cancel overtime monitoring of screen-on and increase overtime monitoring of screen-off, if the display screen is not currently performing an action, the decision-making display screen needs to perform screen-off. And if the decision display screen does not need to be turned on or off, ending the process.
If the power state of the display screen is off or partially on, namely the display screen is in a screen-off or partial screen-off state, when a distributed power event is received, determining that user operation corresponding to the power event is screen-on operation, if the display screen is currently performing screen-on, deciding that the display screen does not need to perform screen-on or screen-off, if the display screen is currently performing screen-off, deciding that the display screen needs to perform screen-on, performing overtime monitoring of screen-off and increasing overtime monitoring of screen-on, and if the display screen is not currently performing action, deciding that the display screen needs to perform screen-on. And if the decision display screen does not need to be turned on or off, ending the process.
S5034, if the decision display screen needs to be lighted, sending a screen-lighting instruction to the kernel layer.
S5035, if the decision display screen needs to execute the screen-off, sending a screen-off instruction to the kernel layer.
S5036, determining whether the power event is blocked at the framework layer based on the countdown of the second timeout. Specifically, when a screen-on instruction or a screen-off instruction is sent to the kernel layer, whether the countdown of the second timeout time is ended is judged. If the countdown of the second timeout period is not over, it is determined that the power event is not blocked at the framework layer, and then S504 is performed. If the countdown of the second timeout period is over, it is determined that the power event is blocked at the framework layer, and then S505 is performed. It is understood that if the countdown based on the second timeout period is ended when the frame layer sends the screen-on command or the screen-off command to the kernel layer, the frame layer may process the power event for more than the second timeout period, so that it may be determined that the power event is blocked at the frame layer.
In another embodiment of the present application, when a screen-on instruction or a screen-off instruction is sent to the kernel layer, the current time s3 is obtained, and a difference between the current time s3 and the current time s2 is determined. If the difference between the current time s3 and the current time s2 is greater than the second timeout time, it is determined that the power event is blocked at the framework layer 101. If the difference between the current time s3 and the current time s2 is less than or equal to the second timeout time, it is determined that the power event is not blocked in the framework layer 101. It is to be understood that if the difference between the current time s3 and the current time s2 is greater than the second timeout period, the framework layer is determined to be blocking at the framework layer because the processing time of the power event exceeds the second timeout period.
S504, determining that the screen on or off of the display screen is normal, and controlling the screen on or off of the display screen by the inner core layer based on the screen on instruction or the screen off instruction.
In an embodiment of the application, when the kernel layer receives a screen-lighting instruction, the brightness of the display screen is set through the display screen driving interface, and the display screen is driven to be on according to the brightness of the display screen. And when the kernel layer receives the screen-off instruction, stopping driving the display screen to be on so as to control the display screen to be off, or setting the brightness of the display screen to be 0.
And S505, determining that the display screen is on or off abnormally.
In an embodiment of the present application, if the transmission of the power event is blocked in the kernel layer or the power event is blocked in the frame layer, it is determined that the display screen is turned on or off abnormally. If the fact that the display screen is turned on or turned off abnormally is determined, the inner core layer can still control the display screen to be turned on based on the screen turning-on instruction or control the display screen to be turned off based on the screen turning-off instruction.
Fig. 7 is a flowchart of a screen display detection method according to another embodiment of the present disclosure. The method is applied to the electronic device 100, and specifically comprises the following steps:
S701-S702 are the same as S501-S502 above and are not described again here.
S703, judging whether the power supply event is blocked in the frame layer.
In an embodiment of the present application, for the sake of clarity and completeness of description of S703, referring to the flowchart of fig. 8 for refining S703, determining whether the power event is blocked at the frame layer includes:
S7031-S7033 are the same as S5031-S5033 above and will not be described again here.
S7034, if the display screen needs to be lightened, the brightness of the display screen to be set on the frame layer is obtained, and whether the brightness of the display screen to be set is effective or not is judged. Specifically, whether the brightness of the display screen to be set meets the screen lightening requirement of the display screen is judged. If the brightness of the display screen to be set meets the brightness requirement of the display screen, determining that the brightness of the display screen to be set is effective, and if the brightness of the display screen to be set does not meet the brightness requirement of the display screen, determining that the brightness of the display screen to be set is ineffective. Specifically, whether the percentage of the brightness of the display screen to be set to the maximum brightness of the display screen is greater than or equal to a second threshold value or not is judged, and if the percentage of the brightness of the display screen to be set to the maximum brightness of the display screen is greater than or equal to the second threshold value, it is determined that the brightness of the display screen to be set meets the brightness requirement of the display screen, and then it is determined that the brightness of the display screen to be set is effective. And if the percentage of the brightness of the display screen to be set to the maximum brightness of the display screen is smaller than a second threshold value, determining that the brightness of the display screen to be set does not meet the brightness requirement of the display screen, and further determining that the brightness of the display screen to be set is invalid. The second threshold may be set according to requirements, and optionally, the second threshold is 10% or 15%. For example, if the maximum value of the luminance of the display screen is 3000nit, and the luminance of the display screen to be set is 10nit, the percentage of the luminance of the display screen to be set to the maximum luminance of the display screen is 0.33%, and the percentage is smaller than the second threshold, it is determined that the luminance of the display screen to be set does not meet the luminance requirement of the display screen, and it is determined that the luminance of the display screen to be set is invalid.
And S7035, if it is determined that the brightness of the display screen to be set is invalid, re-determining the brightness of the display screen to be set until the brightness of the display screen to be set is valid.
And S7036, if the brightness of the display screen to be set is determined to be effective, judging whether the display screen finishes window drawing.
Specifically, whether the display screen finishes window drawing is judged through the frame check, and the window can be a desktop interface or an application interface of the electronic device. The drawing process of the frame layer to the window to be displayed on the display screen comprises the following steps: adding view control view to screen window: creating a top-level layout container DecorView, loading a basic layout Viewgroup in the top-level layout container, and adding ContentView into FrameLayout in the basic layout; and (3) view drawing window: and calling the size of a DecorView measurement window, calling view. And if the view finishes the window drawing, determining that the display screen finishes the window drawing. And if the view does not finish the window drawing, determining that the display screen does not finish the window drawing.
S7037, if the display screen finishes window drawing, calling a driving interface to set the brightness of the display screen, and transmitting the set brightness of the display screen to the kernel layer.
And S7038, if the decision display screen needs to be executed, sending a screen-off instruction to the kernel layer.
S7039, it is determined whether the power event is blocked at the framework layer based on the countdown of the second timeout. Specifically, when the set brightness of the display screen is transmitted to the kernel layer or a screen-off instruction is sent to the kernel layer, whether the countdown of the second timeout time is finished is judged. If the countdown of the second timeout period is not over, it is determined that the power event is not blocked at the framework layer, and S704 or S708 is performed. If the countdown of the second timeout period is over, it is determined that the power event is blocked at the framework layer, and S706 is performed. It is understood that if the countdown based on the second timeout period ends when the frame layer transmits the set brightness of the display screen to the kernel layer or sends the screen-off command to the kernel layer, the frame layer may process the power event for a time period exceeding the second timeout period, so that it may be determined that the power event is blocked in the frame layer.
In another embodiment of the present application, when the set brightness of the display screen is transmitted to the kernel layer or a screen-off command is sent to the kernel layer, the current time s3 is obtained, and a difference between the current time s3 and the current time s2 is determined. And if the difference value between the current time s3 and the current time s2 is larger than the second timeout time, determining that the power supply event is blocked in the framework layer. And if the difference value between the current time s3 and the current time s2 is less than or equal to the second timeout time, determining that the power supply event is not blocked in the framework layer. It is to be understood that if the difference between the current time s3 and the current time s2 is greater than the second timeout period, the framework layer is determined to be blocking at the framework layer because the processing time of the power event exceeds the second timeout period.
S704, the kernel layer receives the brightness of the display screen, the display screen driving interface is called to set the brightness of the display screen, and whether the actual display brightness of the display screen is consistent with the set brightness of the display screen or not is judged when the display screen is bright.
In an embodiment of the application, after the kernel layer receives the brightness of the display screen, timing of the second overtime detection node is cancelled, the first overtime detection node is accessed, and countdown is performed based on the third overtime. Specifically, after receiving the brightness of the display screen, the kernel layer obtains the current time s4, and accesses the first timeout detection node through the kernel driver. In an embodiment of the application, the third timeout time may be a preset time, or may be a time set when the kernel layer receives the brightness of the display screen for the first time. The third timeout time may be set according to requirements, and optionally, the third timeout time is 0.5 milliseconds.
In an embodiment of the application, after the display screen driving interface is called to set the brightness of the display screen, the display screen is driven to be bright through the display screen driving interface, and the actual display brightness of the display screen is obtained.
In an embodiment of the present application, determining whether the actual display brightness of the display screen matches the set display screen brightness includes: judging whether the actual display brightness of the display screen is the same as the set display screen brightness, if so, determining that the actual display brightness of the display screen is consistent with the set display screen brightness, and if not, determining that the actual display brightness of the display screen is inconsistent with the set display screen brightness.
In another embodiment of the present application, determining whether the actual display brightness of the display screen matches the set display screen brightness comprises: judging whether the difference value between the actual display brightness of the display screen and the set display screen brightness is smaller than a third threshold value or not, if the difference value between the actual display brightness of the display screen and the set display screen brightness is smaller than the third threshold value, determining that the actual display brightness of the display screen is consistent with the set display screen brightness, and if the difference value between the actual display brightness of the display screen and the set display screen brightness is larger than or equal to the third threshold value, determining that the actual display brightness of the display screen is not consistent with the set display screen brightness.
In an embodiment of the application, if it is determined that the actual display brightness of the display screen does not conform to the set display screen brightness, the display screen driving interface is used for re-driving the display screen to be bright according to the set display screen brightness until the actual display brightness of the display screen conforms to the set display screen brightness.
S705, judging whether the brightness setting of the display screen is blocked in the kernel layer.
In an embodiment of the present application, determining whether the display screen brightness setting is blocked in the kernel layer includes: and when the actual display brightness of the display screen is determined to be consistent with the set display screen brightness, judging whether the countdown of the third timeout time is finished. If the countdown of the third timeout period is determined to be finished, it is determined that the brightness of the display screen is set to be blocked in the kernel layer, and S706 is performed. And if the countdown of the third timeout time is not finished, determining that the brightness setting of the display screen is not blocked in the kernel layer, executing S707, and determining that the bright screen of the display screen is normal.
In another embodiment of the present application, when it is determined that the actual display brightness of the display screen coincides with the set display screen brightness, the current time s5 is obtained, and the difference between the current time s5 and the current time s4 is determined. And if the difference value between the current time s5 and the current time s4 is greater than the third timeout time, determining that the brightness of the display screen is set to be blocked in the kernel layer. And if the difference value between the current time s5 and the current time s4 is less than or equal to the third timeout time, determining that the brightness setting of the display screen is not blocked in the kernel layer. It is understood that if the difference between the current time s5 and the current time s4 is greater than the third timeout period, the kernel layer setting time of the brightness of the display screen exceeds the third timeout period, so that the brightness setting of the display screen can be determined to be blocked in the kernel layer.
Fig. 9 is a schematic view of a bright screen application scene of the screen display detection method according to an embodiment of the present application.
When the electronic equipment is in a screen-off state, a user can execute screen-on operation to control the electronic equipment to light up, and in the screen-on process of the electronic equipment, whether the electronic equipment is on screen or not, whether the electronic equipment is blocked or not, whether the electronic equipment is abnormal in brightness or not and whether the electronic equipment is drawn normally or not are detected.
In one embodiment of the present application, it is monitored whether a power key is blocked in the kernel: the power key event is detected by the kernel driver, the current time s1 is obtained before the power key event is transmitted to the frame layer, the KHD overtime detection node is accessed for processing, the overtime duration is set, and the countdown is performed after the setting is finished. Detecting whether the power key is blocked in the frame: the framework acquires a power supply event through the EventHub, acquires the difference between the current time and s1 (if the difference exceeds a certain range, a corresponding log is captured), accesses an overtime mechanism AHD in the system _ server, sets the overtime duration, and cancels an overtime timer set to the KHD in the kernel drive. The framework decides the processing to be performed by the power key at this time according to the current brightness value (whether the current brightness value is smaller than a certain threshold), the state of the powermanager (on/off/aod), whether the on/off screen is processed, the flow needs to be changed and the like. Specifically, if it is already in the screen-up process (e.g., in the raising-hand screen-up), the screen-up is cancelled this time. And if the screen is being extinguished currently, the power key is to be subjected to screen lightening processing, the overtime monitoring of screen extinguishing is cancelled, and the overtime monitoring of screen lightening is increased. Acquiring brightness which should be set, detecting whether the brightness value meets the expectation of screen lightening, and calling a driving interface to set the brightness value. If the time is not overtime at the time when the AHD is set, the overtime timer in the system _ server is cancelled, the inner core KHD overtime node is accessed, and the overtime duration is set. Monitoring whether the set brightness is blocked in the kernel: the LCD driver sets the brightness, and then checks whether the expected brightness is achieved after the setting.
Referring to fig. 10A-10B, a flowchart of a screen display detection method according to another embodiment of the present application is shown. The method is applied to the electronic device 100, and specifically comprises the following steps:
s301, detecting a power key. S301 includes: s3011, accessing a kernel node timeout mechanism and setting timeout time. S3012, the kernel node executes a KHD timeout mechanism. S302,/dev/input gets the event. S303, acquiring the power supply event by the EventHub. S303 includes: s3031, the timer set in the kernel driver is cancelled. S3032, accessing a system _ server timeout mechanism and setting timeout time. S3033, system _ server executes FHD timeout mechanism. S3034, the timed access kernel node timeout mechanism. S304, the inputDispatcher dispatches the event. And S305, acquiring the power state. S305 includes: and S3051, acquiring the screen brightness set last time. And S3052, acquiring the driving brightness of the display screen. S3053, acquiring power management states (ScreenOn, screenOff and AOD). S306, whether the screen on/off process is carried out at present is determined. S306 comprises the following steps: s3061, whether the current power management state is in a non-on (ScreenOn) state. S3062, whether the current screen brightness is less than a threshold (e.g., 100/50 nit). S3063, whether the screen brightening/blanking process is processed or not. S307, if the current screen-lighting process is decided, a brightness value to be set is obtained, and whether the brightness value meets the expectation is checked. S307 includes: s3071, whether the flow is stuck/blocked causes the set brightness to be ineffective. S3072, judging whether the set brightness value meets the degree of screen lightening (for example, when a power key is pressed to lighten the screen, the brightness is only set to be 10nit, and the brightness range is 0-3000/9000nit and the like). S3073, it is checked whether the window to be displayed has been drawn (for frame check). And S308, calling a driving interface and setting the brightness. And S309, driving the display screen to set the brightness, and checking the brightness value after setting to perform secondary expected checking. S3091, accessing a kernel node timeout mechanism, setting timeout time, and repeating S3071-S3072.
And S708, the kernel layer controls the screen to be turned off based on the screen turning-off instruction.
In an embodiment of the application, when the kernel layer receives a screen-off instruction, the kernel layer stops driving the display screen to be on, so as to control the display screen to be off, or set the brightness of the display screen to be 0.
Fig. 11 is a schematic view of a screen-off application scene of a screen display detection method according to another embodiment of the present application.
When the electronic device 100 is in a bright screen state, a user may perform a screen-off operation to control the electronic device to turn off the screen, and detect whether to turn off the screen, detect whether to block, and detect whether to send back light in the screen-off process of the electronic device.
In one embodiment of the present application, it is monitored whether a power key is blocked in the kernel: the power key event is detected by the kernel driver, the current time s1 is obtained before the power key event is transmitted to the frame, the KHD overtime detection node is accessed for processing, the overtime duration is set, and the countdown is performed after the setting is finished. Detecting whether the power key is blocked in the frame: the framework acquires a power supply event through the EventHub, acquires the difference between the current time and s1 (if the difference exceeds a certain range, a corresponding log is captured), accesses an overtime mechanism AHD in the system _ server, sets the overtime duration, and cancels an overtime timer set to the KHD in the kernel drive. The framework decides the processing to be performed by the power key at this time according to the state (on/off/AOD) of the powermanager, whether the on/off screen is processed, the flow needs to be changed and the like. Specifically, if it is already currently in the screen-off process, the screen-off is cancelled this time. And if the bright screen is processed currently and the power key is going to be subjected to screen-off processing this time, canceling the overtime monitoring of the bright screen and increasing the overtime monitoring of the screen-off. If the time is not overtime at the moment from the setting of AHD, canceling the overtime timer in system _ server, accessing the overtime node of the KHD, and setting the overtime duration. And monitoring whether the screen blanking is set to be blocked in the kernel or not, and monitoring whether the electronic equipment issues backlight in the screen blanking processing process or not. If the screen is not normally extinguished, the screen is blocked in the kernel, or the electronic equipment issues backlight in the process of processing screen extinguishing, and the abnormal screen extinguishing of the display screen is determined.
The steps of deciding the current screen turning-off process in the screen turning-off process flow are the same as S301-S306 in fig. 10A. If the current screen turn-off process is decided in S306, a driving interface is called in the frame layer to set the brightness of the display screen to 0, the brightness of the display screen is set to 0 in the kernel layer through LCD driving, and whether the brightness setting is frame layer or kernel layer blocking and whether backlight is issued is detected.
And S707, determining whether the display screen is on or off abnormally.
In an embodiment of the application, if the transmission of the power event is blocked in the kernel layer, the power event is blocked in the frame layer, or the brightness of the display screen is set to be blocked in the kernel layer, it is determined that the display screen is turned on or turned off abnormally. If the display screen is determined to be on or off abnormally, the inner core layer can still control the display screen to be on based on the set display screen brightness or control the display screen to be off based on the screen-off instruction.
Referring to fig. 12, a flowchart of a screen display detection method according to another embodiment of the present application is shown. The method is applied to the electronic device 100, and specifically comprises the following steps:
s901 to S908 are the same as S701 to S708 above, respectively, and a description thereof will not be repeated.
And S909, obtaining the abnormal event to generate a log, and uploading the log to a server.
Fig. 13 is a schematic view of a communication architecture of an electronic device according to an embodiment of the present disclosure. The electronic apparatus 100 is communicatively connected to the server 200 via the network 300. For example, the network 300 may be at least one of a 2G network, a 3G network, a 4G-LET network, or a 5G New air interface (5G-New Radio) network.
It should be noted that the above description does not constitute a limitation on the communication architecture of the electronic device of the present application, and the communication architecture diagram of the electronic device of the present application includes, but is not limited to, the example shown in fig. 13.
In an embodiment of the present application, obtaining the exception event to generate the log includes: and when the brightness detection is abnormal or the screen on/off event processing is blocked, acquiring an abnormal event according to a preset rule to generate a log.
Specifically, the luminance detection abnormality includes: the driving brightness of the display screen is smaller than the first threshold value, the brightness of the display screen to be set is invalid, and the actual display brightness of the display screen is not consistent with the set brightness of the display screen. The bright and dark screen event handling blocking comprises: the transmission of power events is blocked at the kernel layer, power events are blocked at the frame layer, and display screen brightness is set to be blocked at the kernel layer. The path, node or processing flow of the blocked bright and dark screen event processing can be determined based on the countdown of the first overtime detection node and the second overtime detection node. For example, if it is determined that the time for the on-off screen processing time to stay in a path, node, or processing flow exceeds the threshold time based on the countdown of the first timeout detection node and the second timeout detection node, or the countdown of the first timeout detection node and the second timeout detection node is ended in a path, node, or processing flow, it is determined that the on-off screen processing event is blocked in the path, node, or processing flow, and the path, node, or processing flow and related information (e.g., the stay time, etc.) are written into the log as the abnormal event.
Specifically, the obtaining of the abnormal event according to the preset rule includes: and obtaining the measurement information of the abnormal event according to a preset privacy rule, and writing the abnormal event and the corresponding abnormal information into the abnormal node/path. The maintenance information includes call stack information and additional information, and the call stack information may include system _ server information, surfaceflector information, graphics information, and associated apk (application package) process, native process, and the like. The accessory information may include binder (inter-process communication mechanism) information, dump sys information, memory information, cpu scheduling information, and the like. The preset privacy rules include: the acquired call stack information and additional information do not include privacy information of the user, such as location information, communication information, and the like.
Fig. 14 is a schematic view of a flow monitoring logic of the screen display detection method according to an embodiment of the present application. The process monitoring logic specifically includes:
and S1101, if the power key is triggered, the kernel layer performs kernel power event transmission blocking monitoring.
And S1102, the framework layer performs acquisition timeout monitoring on the power event.
And S1103, the framework layer performs distribution timeout monitoring on the power supply event.
And S1104, the frame layer acquires the system state (screen on/off, brightness, AOD and the like).
And S1105, the framework layer makes the power event processing decision.
S1106, the frame layer determines the validity of the brightness value to be set.
And S1107, the frame layer sets the blocking monitoring in the on-off screen state.
S1108, the frame layer transmits the brightness value and sets the blocking monitoring.
S1109, the kernel layer performs kernel display screen (LCD) to set brightness.
S1110, the kernel layer performs kernel display screen (LCD) brightness secondary detection.
S1111, capturing an exception log.
S1112, reporting the exception log, for example, to a website operated by the server.
The present embodiment also provides a computer storage medium, in which computer instructions are stored, and when the computer instructions are run on the electronic device 100, the electronic device 100 is caused to execute the screen display detection method in the foregoing embodiments.
The present embodiment also provides a computer program product, which, when running on a computer, causes the computer to execute the screen display detection method in the above embodiments.
In addition, embodiments of the present application also provide an apparatus, which may be specifically a chip, a component or a module, and may include a processor and a memory connected to each other; when the device runs, the processor can execute the computer execution instructions stored in the memory, so that the chip can execute the screen display detection method in the above method embodiments.
The electronic device, the computer storage medium, the computer program product, or the chip provided in this embodiment are all configured to execute the corresponding method provided above, so that the beneficial effects achieved by the electronic device, the computer storage medium, the computer program product, or the chip can refer to the beneficial effects of the corresponding method provided above, and are not described herein again.
Through the above description of the embodiments, it is clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the above described functions.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the module or unit is only one type of logical function division, and other division manners may be available in actual implementation, for example, a plurality of units or components may be combined or integrated into another apparatus, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may be one physical unit or a plurality of physical units, that is, may be located in one place, or may be distributed to a plurality of different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application, or portions of the technical solutions that substantially contribute to the prior art, or all or portions of the technical solutions may be embodied in the form of a software product, where the software product is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or a portion of the methods of the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, an optical disk, or other various media capable of storing program codes.
Finally, it should be noted that the above embodiments are only used for illustrating the technical solutions of the present application and not for limiting, and although the present application is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions can be made on the technical solutions of the present application without departing from the spirit and scope of the technical solutions of the present application.

Claims (23)

1. A method for detecting a screen display, the method comprising:
acquiring a power supply event for controlling the screen on or off of a display screen through an inner core layer, and transmitting the power supply event to a frame layer;
acquiring the power supply event through the framework layer, and judging whether the transmission of the power supply event is blocked in the inner core layer;
if the power supply event is determined not to be blocked in the inner core layer, judging whether the power supply event is blocked in the framework layer;
and if the power supply event is determined not to be blocked in the frame layer, controlling the display screen to be on or off through the inner core layer.
2. The screen display detection method of claim 1, wherein obtaining a power event controlling the turning on or off of the display screen through the kernel layer comprises:
and detecting whether a user performs screen on or screen off operation, and if the user performs the screen on or screen off operation, acquiring the power supply event.
3. The screen display detection method of claim 2, wherein communicating the power event to a frame comprises:
after the power event is obtained, the kernel layer is accessed to a first overtime detection node, the first overtime detection node is controlled to count down based on first overtime, and the power event is transmitted to the framework layer.
4. The screen display detection method of claim 3, wherein determining whether the delivery of the power event is blocked at the kernel layer comprises:
before the framework layer acquires a power event, judging whether countdown based on the first timeout time is finished; if the countdown based on the first timeout time is determined to be finished before the framework layer acquires the power event, determining that the power event is blocked in a kernel layer; or
If the countdown based on the first timeout is not finished before the framework layer acquires the power event, determining that the transmission of the power event is not blocked in the kernel layer.
5. The screen display detection method of claim 4, wherein acquiring the power event via the frame layer comprises:
and the framework layer acquires the power supply event transmitted by the kernel layer through an open source event analysis platform and distributes the power supply event through an input event processing mechanism.
6. The screen display detection method of claim 3, wherein determining whether the power event is blocked at the frame layer comprises:
after the framework layer acquires the power event, accessing a second overtime detection node by the framework layer, and controlling the second overtime detection node to count down based on second overtime;
acquiring the state of the display screen, and deciding whether the display screen needs to be turned on or off according to the state of the display screen;
if the display screen needs to be subjected to screen lightening, sending a screen lightening instruction to the inner core layer; or
If the display screen needs to be executed, sending a screen-off instruction to the kernel layer;
determining whether the power event is blocked at the framework layer based on a countdown of the second timeout.
7. The screen display detection method of claim 6, wherein determining whether the power event is blocked at the frame layer further comprises:
and in the process that the second overtime detection node counts down based on the second overtime, sending heartbeat packets to the first overtime detection node at preset intervals so as to detect whether the second overtime detection node works normally or not in real time.
8. The screen display detection method of claim 6, wherein the state of the display screen comprises a power state, the power state comprising on, off, and partially on.
9. The screen display detection method of claim 8, wherein deciding whether the display screen needs to be turned on or off based on the state of the display screen comprises:
deciding whether the display screen needs to be turned on or off according to the power state of the display screen;
if the power state of the display screen is off or partially on, determining that the user operation corresponding to the power event is a screen lightening operation, and deciding that the display screen needs to be lightened; or
And if the power state of the display screen is on, determining that the user operation corresponding to the power event is a screen-off operation, and deciding that the screen-off of the display screen needs to be executed.
10. The screen display detection method of claim 8, wherein the state of the display screen further comprises a display screen driving brightness, and the deciding whether the display screen needs to perform a turn-on or turn-off according to the state of the display screen comprises:
deciding whether the display screen needs to be turned on or off according to the power state of the display screen and the driving brightness of the display screen;
if the power state of the display screen is started and the driving brightness of the display screen is smaller than a first threshold value, determining that the user operation corresponding to the power event is a screen lightening operation, and deciding that the display screen needs to be lightened; or
If the power state of the display screen is on and the driving brightness of the display screen is greater than or equal to a first threshold value, determining that the user operation corresponding to the power event is a screen-off operation, and deciding that the screen-off of the display screen needs to be executed; or
And if the power state of the display screen is closed or partially opened, determining that the user operation corresponding to the power event is a screen lightening operation, and deciding that the display screen needs to be lightened.
11. The screen display detection method of claim 10, wherein deciding whether the display screen needs to be turned on or off based on the state of the display screen further comprises:
according to the power state of the display screen, the driving brightness of the display screen and the action currently executed by the display screen, deciding whether the display screen needs to be turned on or off;
if the power state of the display screen is on and the driving brightness of the display screen is smaller than a first threshold value, determining that the user operation corresponding to the power event is a screen-on operation, if the display screen is currently performing screen-on, deciding that the display screen does not need to perform screen-on or screen-off, if the display screen is currently performing screen-off, deciding that the display screen needs to perform screen-on, and if the display screen is not currently performing action, deciding that the display screen needs to perform screen-on; or
If the power state of the display screen is on and the driving brightness of the display screen is greater than or equal to a first threshold value, determining that user operation corresponding to the power event is screen-off operation, if the display screen is currently executing screen-off, deciding that the display screen does not need to be turned on or off, if the display screen is currently executing screen-on, deciding that the display screen needs to be turned off, and if the display screen is not currently executing action, deciding that the display screen needs to be turned off; or
And if the power state of the display screen is closed or partially opened, determining that the user operation corresponding to the power event is a screen-on operation, if the display screen is currently performing screen-on, deciding that the display screen does not need to perform screen-on or screen-off, if the display screen is currently performing screen-off, deciding that the display screen needs to perform screen-on, and if the display screen is not currently performing action, deciding that the display screen needs to perform screen-on.
12. The screen display detection method of claim 11, wherein deciding whether the display screen needs to be turned on or off according to the state of the display screen further comprises:
if it is determined that the user operation corresponding to the power supply event is a screen-on operation and the display screen is currently in a screen-off state, deciding that the display screen needs to be subjected to screen-on, and performing overtime monitoring of screen elimination and overtime monitoring of screen-on increase; or
And if the user operation corresponding to the power supply event is determined to be screen-off operation and the display screen is currently in bright screen execution, deciding that the display screen needs to be screen-off, and canceling the overtime monitoring of the bright screen and increasing the overtime monitoring of the screen-off.
13. The screen display detection method of claim 6, wherein determining whether the power event is blocked at the frame layer based on a countdown of the second timeout period comprises;
when the screen lightening instruction or the screen extinguishing instruction is sent to the kernel layer, whether countdown of the second overtime time is finished or not is judged;
if the countdown of the second timeout period is not finished, determining that the power event is not blocked in the framework layer; or
And if the countdown of the second timeout period is finished, determining that the power supply event is blocked in the framework layer.
14. The screen display detection method of claim 6, wherein determining whether the power event is blocked at the frame layer further comprises:
if the display screen needs to be subjected to screen lightening, acquiring the brightness of the display screen to be set of the frame layer, and judging whether the brightness of the display screen to be set is effective or not;
if the brightness of the display screen to be set is determined to be invalid, the brightness of the display screen to be set is determined again until the brightness of the display screen to be set is valid; or
If the brightness of the display screen to be set is determined to be effective, judging whether the display screen finishes window drawing;
and if the display screen finishes window drawing, calling a driving interface to set the brightness of the display screen to be set, and transmitting the set brightness of the display screen to the kernel layer.
15. The screen display detection method of claim 14, wherein determining whether the display screen brightness to be set is valid comprises:
judging whether the percentage of the brightness of the display screen to be set to the maximum brightness of the display screen is larger than or equal to a second threshold value or not;
if the percentage of the brightness of the display screen to be set to the maximum brightness of the display screen is larger than or equal to the second threshold value, determining that the brightness of the display screen to be set is effective; or
And if the percentage of the brightness of the display screen to be set to the maximum brightness of the display screen is smaller than the second threshold value, determining that the brightness of the display screen to be set is invalid.
16. The screen display detection method of claim 15, wherein the method further comprises:
the kernel layer receives the set display screen brightness, a display screen driving interface is called to set the display screen brightness, and whether the actual display brightness of the display screen is consistent with the set display screen brightness or not is judged when the display screen is bright;
if the fact that the actual display brightness of the display screen is not accordant with the set display screen brightness is determined, the display screen is driven to be on again through the display screen driving interface according to the set display screen brightness until the actual display brightness of the display screen is accordant with the set display screen brightness;
and judging whether the brightness setting of the display screen is blocked in the inner core layer.
17. The screen display detection method of claim 16, wherein the method further comprises:
after receiving the brightness of the display screen, the kernel layer accesses the first overtime detection node and controls the first overtime detection node to count down based on third overtime;
determining whether a display screen brightness setting is blocked at the kernel layer comprises:
judging whether the countdown of the third overtime time is finished or not when the actual display brightness of the display screen is determined to be consistent with the set display screen brightness;
if the countdown of the third overtime time is determined to be finished, determining that the brightness of the display screen is set to be blocked in the kernel layer; or
And if the countdown of the third timeout time is not finished, determining that the brightness setting of the display screen is not blocked in the inner core layer.
18. The screen display detection method of claim 17, wherein the method further comprises:
and if the transmission of the power supply event is determined to be blocked in the inner core layer, the power supply event is determined to be blocked in the frame layer, or the brightness of the display screen is determined to be set to be blocked in the inner core layer, the abnormal screen turning-on or turning-off of the display screen is determined.
19. The screen display detection method of any one of claims 1-18, wherein the method further comprises:
and acquiring the abnormal event to generate a log, and uploading the log to a server.
20. The screen display detection method of claim 19, wherein obtaining the exception event to generate a log comprises:
and when the brightness detection is abnormal or the screen on/off event processing is blocked, acquiring the abnormal event according to a preset rule to generate the log.
21. The screen display detection method of claim 20, wherein obtaining the exception event according to a preset rule comprises:
obtaining the maintenance and measurement information of the abnormal event according to a preset privacy rule, and writing the abnormal event and the corresponding abnormal information into an abnormal node or path, wherein the maintenance and measurement information comprises call stack information and additional information, and the preset privacy rule comprises: the acquired call stack information and the additional information do not contain privacy information of the user.
22. An electronic device, characterized in that the electronic device comprises a memory and a processor:
wherein the memory is to store program instructions;
the processor configured to read and execute the program instructions stored in the memory, and when the program instructions are executed by the processor, cause the electronic device to perform the screen display detection method according to any one of claims 1 to 21.
23. A computer storage medium storing program instructions that, when run on an electronic device, cause the electronic device to perform the screen display detection method of any one of claims 1 to 21.
CN202110956799.1A 2021-08-19 2021-08-19 Screen display detection method, electronic device and storage medium Pending CN115904297A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110956799.1A CN115904297A (en) 2021-08-19 2021-08-19 Screen display detection method, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110956799.1A CN115904297A (en) 2021-08-19 2021-08-19 Screen display detection method, electronic device and storage medium

Publications (1)

Publication Number Publication Date
CN115904297A true CN115904297A (en) 2023-04-04

Family

ID=86471430

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110956799.1A Pending CN115904297A (en) 2021-08-19 2021-08-19 Screen display detection method, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN115904297A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117177059A (en) * 2023-10-27 2023-12-05 荣耀终端有限公司 Camera control method for video call, electronic device and storage medium
CN117707453A (en) * 2023-08-15 2024-03-15 荣耀终端有限公司 Method, equipment and storage medium for reading node information

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117707453A (en) * 2023-08-15 2024-03-15 荣耀终端有限公司 Method, equipment and storage medium for reading node information
CN117177059A (en) * 2023-10-27 2023-12-05 荣耀终端有限公司 Camera control method for video call, electronic device and storage medium
CN117177059B (en) * 2023-10-27 2024-04-12 荣耀终端有限公司 Camera control method for video call, electronic device and storage medium

Similar Documents

Publication Publication Date Title
CN113704014B (en) Log acquisition system, method, electronic device and storage medium
CN114443277A (en) Memory management method and device, electronic equipment and computer readable storage medium
WO2021013132A1 (en) Input method and electronic device
CN114168065B (en) Method and device for adjusting memory configuration parameters
CN113704205B (en) Log storage method, chip, electronic device and readable storage medium
CN113805797B (en) Processing method of network resource, electronic equipment and computer readable storage medium
CN113645341A (en) Power key false touch detection method and electronic equipment
US20230385112A1 (en) Memory Management Method, Electronic Device, and Computer-Readable Storage Medium
CN113641271A (en) Application window management method, terminal device and computer readable storage medium
CN115904297A (en) Screen display detection method, electronic device and storage medium
CN115333941A (en) Method for acquiring application running condition and related equipment
CN113656089B (en) Class verification method and device in application program
CN116048831B (en) Target signal processing method and electronic equipment
CN114489469B (en) Data reading method, electronic equipment and storage medium
CN117130541A (en) Storage space configuration method and related equipment
CN115482143B (en) Image data calling method and system for application, electronic equipment and storage medium
CN113407300B (en) Application false killing evaluation method and related equipment
CN116703689B (en) Method and device for generating shader program and electronic equipment
CN116684520B (en) Shutdown method, electronic equipment, storage medium and chip
CN116662150B (en) Application starting time-consuming detection method and related device
CN114006969B (en) Window starting method and electronic equipment
CN116703691B (en) Image processing method, electronic device, and computer storage medium
CN116991274B (en) Upper sliding effect exception handling method and electronic equipment
WO2023246783A1 (en) Method for adjusting device power consumption and electronic device
CN117707405A (en) Display screen control method and related equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination