[go: up one dir, main page]

CN116450423A - Fault detection method and electronic device - Google Patents

Fault detection method and electronic device Download PDF

Info

Publication number
CN116450423A
CN116450423A CN202210018485.1A CN202210018485A CN116450423A CN 116450423 A CN116450423 A CN 116450423A CN 202210018485 A CN202210018485 A CN 202210018485A CN 116450423 A CN116450423 A CN 116450423A
Authority
CN
China
Prior art keywords
state
screen
scene
electronic device
electronic equipment
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
CN202210018485.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 CN202210018485.1A priority Critical patent/CN116450423A/en
Publication of CN116450423A publication Critical patent/CN116450423A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2205Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
    • G06F11/2221Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested to test input/output devices or peripheral units
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2273Test methods
    • 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

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Telephone Function (AREA)

Abstract

本申请提供了一种故障检测方法及电子设备置,该方法包括:响应于用户对电子设备的电源键的按压操作,启动定时器,接收到按压操作之后电子设备进入AOD显示状态;获取第一亮灭状态,第一亮灭状态是电源键被按压之前电子设备屏幕的亮灭状态;将第二亮灭状态设置为灭屏状态,其中,第二亮灭状态用于表示电源键被按压之后电子设备屏幕的亮灭状态;在定时器的定时达到指定时长时基于第一亮灭状态和第二亮灭状态执行亮灭屏故障检测操作。申请可根据电子设备当前所处的场景,采取不同的故障检测策略,以避免对亮灭屏故障的误检测,进而提高故障检测的准确性。

The present application provides a fault detection method and an electronic device device. The method includes: responding to the user's pressing operation on the power button of the electronic device, starting a timer, and the electronic device enters the AOD display state after receiving the pressing operation; obtaining the first The on-off state, the first on-off state is the on-off state of the screen of the electronic device before the power button is pressed; the second on-off state is set to the off-screen state, wherein the second on-off state is used to indicate that the power button is pressed The on-off state of the screen of the electronic device; when the timing of the timer reaches the specified duration, the on-off screen fault detection operation is performed based on the first on-off state and the second on-off state. The application can adopt different fault detection strategies according to the current scene of the electronic device, so as to avoid false detection of faults with on and off screens, and thus improve the accuracy of fault detection.

Description

故障检测方法及电子设备Fault detection method and electronic device

技术领域technical field

本申请实施例涉及终端设备领域,尤其涉及一种故障检测方法及电子设备。The embodiments of the present application relate to the field of terminal equipment, and in particular, to a fault detection method and electronic equipment.

背景技术Background technique

随着终端技术的不断发展,配置有显示屏的终端设备得到越来越多的关注,并且,应用程序的数量也在不断增多,如此导致终端设备在使用过程中会出现不亮或者不灭屏等故障,故对终端设备的亮灭屏故障进行检测是尤为重要,然而现有的亮灭屏故障检测方法在进行故障检测时通常会存在误检测的问题。因此,如何提高故障检测的准确性是亟待解决的技术问题。With the continuous development of terminal technology, more and more attention has been paid to terminal devices equipped with display screens, and the number of application programs is also increasing, which leads to the terminal devices not turning on or turning off the screen during use. Therefore, it is particularly important to detect the on-off screen fault of the terminal equipment. However, the existing on-off screen fault detection methods usually have the problem of false detection when performing fault detection. Therefore, how to improve the accuracy of fault detection is an urgent technical problem to be solved.

发明内容Contents of the invention

为了解决上述技术问题,本申请提供一种故障检测方法及电子设备。在该方法中,通过确定电子设备当前所处的场景,采取不同的故障检测策略,以避免对亮灭屏故障的误检测,进而提高故障检测的准确性。In order to solve the above technical problems, the present application provides a fault detection method and electronic equipment. In this method, different fault detection strategies are adopted by determining the current scene of the electronic device, so as to avoid false detection of screen on and off faults, thereby improving the accuracy of fault detection.

第一方面,本申请实施例提供一种故障检测方法。该方法包括:响应于用户对电子设备的电源键的按压操作,启动定时器,接收到按压操作之后电子设备进入AOD显示状态;电子设备获取第一亮灭状态,第一亮灭状态是电源键被按压之前电子设备屏幕的亮灭状态;电子设备将第二亮灭状态设置为灭屏状态,其中,第二亮灭状态用于表示电源键被按压之后电子设备屏幕的亮灭状态;电子设备在定时器的定时达到指定时长时基于第一亮灭状态和第二亮灭状态执行亮灭屏故障检测操作。这样,电子设备在确定AOD模式处于打开状态时通过强制设置亮灭屏的状态可以保证故障检测的准确性,进而可以降低故障的误检率。In a first aspect, the embodiment of the present application provides a fault detection method. The method includes: starting a timer in response to the pressing operation of the power button of the electronic device by the user, and the electronic device enters the AOD display state after receiving the pressing operation; the electronic device obtains the first on-off state, and the first on-off state is the power button The on-off state of the electronic device screen before being pressed; the electronic device sets the second on-off state as the off-screen state, wherein the second on-off state is used to indicate the on-off state of the electronic device screen after the power button is pressed; the electronic device When the timing of the timer reaches the specified duration, the on-off screen fault detection operation is performed based on the first on-off state and the second on-off state. In this way, when the electronic device determines that the AOD mode is in the on state, the accuracy of fault detection can be ensured by forcibly setting the state of the screen on and off, thereby reducing the false detection rate of faults.

根据第一方面,响应于用户对电子设备的电源键的按压操作,启动定时器,包括:响应于用户对电子设备的电源键的按下操作,确定电子设备是否处于亮屏状态;若电子设备处于亮屏状态,则在接收到抬起操作时,启动定时器。这样,电子设备处于亮屏状态,且在电源键被抬起时启动定时器,可以提高故障检测的精确性。According to the first aspect, starting the timer in response to the pressing operation of the power key of the electronic device by the user includes: determining whether the electronic device is in a bright screen state in response to the pressing operation of the power key of the electronic device by the user; if the electronic device If the screen is on, the timer is started when a lifting operation is received. In this way, the electronic device is in a bright screen state, and the timer is started when the power key is lifted, which can improve the accuracy of fault detection.

根据第一方面,或者以上第一方面的任意一种实现方式,响应于用户对电子设备的电源键的按压操作,启动定时器,包括:响应于用户对电子设备的电源键的按压操作,确定电子设备所处场景是否为特定场景,在特定场景下接收到按压操作时,电子设备屏幕的亮灭状态不发生改变;若电子设备所处场景不是特定场景,则启动定时器。这样,这样电子设备可以更加准确灵活的对亮灭屏故障进行检测。According to the first aspect, or any implementation manner of the above first aspect, starting the timer in response to the user’s pressing operation of the power key of the electronic device includes: in response to the user’s pressing operation of the power key of the electronic device, determining Whether the scene where the electronic device is in is a specific scene, when a press operation is received in a specific scene, the on-off state of the screen of the electronic device does not change; if the scene where the electronic device is in is not a specific scene, a timer is started. In this way, the electronic device can more accurately and flexibly detect the on-off screen fault.

示例性的,特定场景可以包括接近光场景、组合按压场景以及语音唤醒场景。Exemplarily, the specific scene may include a proximity light scene, a combined pressing scene, and a voice wake-up scene.

根据第一方面,或者以上第一方面的任意一种实现方式,若电子设备所处场景为特定场景,则不执行亮灭屏故障检测操作。这样,不仅可以提高故障检测的准确性,同时可以降低亮灭屏故障检测为电子设备带来的不必要功耗。According to the first aspect, or any one of the implementation manners of the above first aspect, if the scene where the electronic device is located is a specific scene, the on-off screen fault detection operation is not performed. In this way, not only can the accuracy of fault detection be improved, but at the same time, unnecessary power consumption of electronic equipment brought about by on-off screen fault detection can be reduced.

根据第一方面,或者以上第一方面的任意一种实现方式,特定场景至少包括接近光场景、组合按压场景和语音唤醒场景;其中,接近光场景是由电子设备处于通话状态时屏幕被遮挡而触发的场景,组合按压场景是由用户同时按压电源键和其它按键而触发的场景,语音唤醒场景是由用户长按电源键而触发人机语音交互的场景。这样,电子设备可以更加准确灵活的对亮灭屏故障进行检测。According to the first aspect, or any implementation of the above first aspect, the specific scene includes at least a proximity light scene, a combined pressing scene, and a voice wake-up scene; wherein, the proximity light scene is caused by the screen being blocked when the electronic device is in a call state. In the triggered scene, the combined pressing scene is a scene triggered by the user pressing the power button and other buttons at the same time, and the voice wake-up scene is a scene in which the user presses the power button for a long time to trigger human-machine voice interaction. In this way, the electronic device can more accurately and flexibly detect the on-off screen fault.

根据第一方面,或者以上第一方面的任意一种实现方式,在定时器的定时达到指定时长时基于第一亮灭状态和第二亮灭状态执行亮灭屏故障检测操作,包括:在定时器的定时达到指定时长时确定第一亮灭状态和第二亮灭状态是否相同;若第一亮灭状态和第二亮灭状态相同,则确定电子设备的屏幕发生故障;若第一亮灭状态和第二亮灭状态不相同,则确定电子设备的屏幕未发生故障。According to the first aspect, or any implementation of the above first aspect, when the timing of the timer reaches the specified duration, the on-off screen fault detection operation is performed based on the first on-off state and the second on-off state, including: When the timing of the device reaches the specified duration, determine whether the first on-off state and the second on-off state are the same; if the first on-off state and the second on-off state are the same, it is determined that the screen of the electronic device is faulty; If the state is different from the second on-off state, it is determined that the screen of the electronic device is not faulty.

示例性的,第一亮灭状态和第二亮灭状态可以为亮屏状态或者是灭屏状态。Exemplarily, the first on-off state and the second on-off state may be a screen-on state or a screen-off state.

示例性的,指定时长可以为6s。Exemplarily, the specified duration may be 6s.

第二方面,本申请实施例提供一种故障检测方法。该方法包括:响应于用户对电子设备的电源键的按压操作,启动定时器,接收到按压操作之前,电子设备处于AOD显示状态;将电源键被按压之前电子设备屏幕的亮灭状态设置为灭屏状态,并将设置后的亮灭状态作为第一亮灭状态;在定时器的定时达到指定时长时获取第二亮灭状态,第二亮灭状态是电源键被按压之后定时器的定时达到指定时长时电子设备屏幕的亮灭状态;基于第一亮灭状态和第二亮灭状态执行亮灭屏故障检测操作。这样,电子设备在确定其处于AOD显示状态时通过强制设置亮灭屏的状态可以保证故障检测的准确性,进而可以降低故障的误检率。In a second aspect, the embodiment of the present application provides a fault detection method. The method includes: responding to the pressing operation of the power key of the electronic device by the user, starting a timer, and before receiving the pressing operation, the electronic device is in the AOD display state; setting the on-off state of the screen of the electronic device before the power key is pressed to off screen status, and take the set on-off state as the first on-off state; get the second on-off state when the timing of the timer reaches the specified duration, and the second on-off state is when the power button is pressed and the timing of the timer reaches The on-off state of the screen of the electronic device for a specified time period; based on the first on-off state and the second on-off state, an on-off screen fault detection operation is performed. In this way, when the electronic device determines that it is in the AOD display state, the accuracy of fault detection can be ensured by forcibly setting the state of the screen on and off, thereby reducing the false detection rate of faults.

根据第二方面,按压操作包括按下操作和抬起操作,响应于用户对电子设备的电源键的按压操作,启动定时器,包括:响应于用户对电子设备的电源键的按下操作,直接启动定时器。这样,电子设备处于AOD屏状态,且在电源键被按下时启动定时器,可以提高故障检测的精确性。According to the second aspect, the pressing operation includes a pressing operation and a lifting operation, and starting the timer in response to the pressing operation of the power key of the electronic device by the user includes: directly responding to the pressing operation of the power key of the electronic device by the user, Start the timer. In this way, the electronic device is in the AOD screen state, and the timer is started when the power key is pressed, which can improve the accuracy of fault detection.

根据第二方面,或者以上第二方面的任意一种实现方式,响应于用户对电子设备的电源键的按压操作,启动定时器,包括:响应于用户对电子设备的电源键的按压操作,确定电子设备所处场景是否为特定场景,在特定场景下接收到按压操作时,电子设备屏幕的亮灭状态不发生改变;若电子设备所处场景不是特定场景,则启动定时器。这样,这样电子设备可以更加准确灵活的对亮灭屏故障进行检测。According to the second aspect, or any implementation of the above second aspect, starting the timer in response to the user pressing the power key of the electronic device includes: in response to the user pressing the power key of the electronic device, determining Whether the scene where the electronic device is in is a specific scene, when a press operation is received in a specific scene, the on-off state of the screen of the electronic device does not change; if the scene where the electronic device is in is not a specific scene, a timer is started. In this way, the electronic device can more accurately and flexibly detect the on-off screen fault.

根据第二方面,或者以上第二方面的任意一种实现方式,若电子设备所处场景为特定场景,则不执行亮灭屏故障检测操作。这样,不仅可以提高故障检测的准确性,同时可以降低亮灭屏故障检测为电子设备带来的不必要功耗。According to the second aspect, or any implementation manner of the above second aspect, if the scene where the electronic device is located is a specific scene, no on-off screen fault detection operation is performed. In this way, not only can the accuracy of fault detection be improved, but at the same time, unnecessary power consumption of electronic equipment brought about by on-off screen fault detection can be reduced.

根据第二方面,或者以上第二方面的任意一种实现方式,特定场景至少包括接近光场景、组合按压场景和语音唤醒场景;其中,接近光场景是由电子设备处于通话状态时屏幕被遮挡而触发的场景,组合按压场景是由用户同时按压电源键和其它按键而触发的场景,语音唤醒场景是由用户长按电源键而触发人机语音交互的场景。According to the second aspect, or any implementation of the above second aspect, the specific scene includes at least a proximity light scene, a combined pressing scene, and a voice wake-up scene; wherein, the proximity light scene is caused by the screen being blocked when the electronic device is in a call state. In the triggered scene, the combined pressing scene is a scene triggered by the user pressing the power button and other buttons at the same time, and the voice wake-up scene is a scene in which the user presses the power button for a long time to trigger human-machine voice interaction.

根据第二方面,或者以上第二方面的任意一种实现方式,基于第一亮灭状态和第二亮灭状态执行亮灭屏故障检测操作,包括:确定第一亮灭状态和第二亮灭状态是否相同;若第一亮灭状态和第二亮灭状态相同,则确定电子设备的屏幕发生故障;若第一亮灭状态和第二亮灭状态不相同,则确定电子设备的屏幕未发生故障。According to the second aspect, or any implementation of the second aspect above, performing the on-off screen fault detection operation based on the first on-off state and the second on-off state includes: determining the first on-off state and the second on-off state Whether the state is the same; if the first on-off state and the second on-off state are the same, it is determined that the screen of the electronic device has a fault; Fault.

第三方面,本申请实施例提供一种电子设备。该电子设备包括:一个或多个处理器;存储器;以及一个或多个计算机程序,其中一个或多个计算机程序存储在存储器上,当计算机程序被一个或多个处理器执行时,使得电子设备执行以下步骤:响应于用户对电子设备的电源键的按压操作,启动定时器,接收到按压操作之后电子设备进入AOD显示状态;获取第一亮灭状态,第一亮灭状态是电源键被按压之前电子设备屏幕的亮灭状态;将第二亮灭状态设置为灭屏状态,其中,第二亮灭状态用于表示电源键被按压之后电子设备屏幕的亮灭状态;在定时器的定时达到指定时长时基于第一亮灭状态和第二亮灭状态执行亮灭屏故障检测操作。In a third aspect, the embodiment of the present application provides an electronic device. The electronic device includes: one or more processors; memory; and one or more computer programs, wherein the one or more computer programs are stored on the memory, and when executed by the one or more processors, the electronic device Perform the following steps: respond to the user's pressing operation of the power button of the electronic device, start the timer, and the electronic device enters the AOD display state after receiving the pressing operation; obtain the first on-off state, the first on-off state is when the power button is pressed The previous on-off state of the electronic device screen; the second on-off state is set to the off-screen state, wherein the second on-off state is used to indicate the on-off state of the electronic device screen after the power button is pressed; when the timer reaches The on-off screen fault detection operation is performed based on the first on-off state and the second on-off state for a specified time period.

根据第三方面,按压操作包括按下操作和抬起操作,当计算机程序被一个或多个处理器执行时,使得电子设备执行以下步骤:响应于用户对电子设备的电源键的按下操作,确定电子设备是否处于亮屏状态;若电子设备处于亮屏状态,则在接收到抬起操作时,启动定时器。According to the third aspect, the pressing operation includes a pressing operation and a lifting operation, and when the computer program is executed by one or more processors, the electronic device is made to perform the following steps: in response to the pressing operation of the power button of the electronic device by the user, Determine whether the electronic device is in a bright screen state; if the electronic device is in a bright screen state, start a timer when a lifting operation is received.

根据第三方面,或者以上第三方面的任意一种实现方式,当计算机程序被一个或多个处理器执行时,使得电子设备执行以下步骤:响应于用户对电子设备的电源键的按压操作,确定电子设备所处场景是否为特定场景,在特定场景下接收到按压操作时,电子设备屏幕的亮灭状态不发生改变;若电子设备所处场景不是特定场景,则启动定时器。According to the third aspect, or any implementation manner of the above third aspect, when the computer program is executed by one or more processors, the electronic device is made to perform the following steps: in response to the user pressing the power button of the electronic device, Determine whether the scene where the electronic device is located is a specific scene. When a press operation is received in a specific scene, the on-off state of the screen of the electronic device does not change; if the scene where the electronic device is not a specific scene, start a timer.

根据第三方面,或者以上第三方面的任意一种实现方式,当计算机程序被一个或多个处理器执行时,使得电子设备执行以下步骤:According to the third aspect, or any implementation manner of the above third aspect, when the computer program is executed by one or more processors, the electronic device is made to perform the following steps:

若电子设备所处场景为特定场景,则不执行亮灭屏故障检测操作。If the scene where the electronic device is located is a specific scene, the on-off screen fault detection operation is not performed.

根据第三方面,或者以上第三方面的任意一种实现方式,特定场景至少包括接近光场景、组合按压场景和语音唤醒场景;其中,接近光场景是由电子设备处于通话状态时屏幕被遮挡而触发的场景,组合按压场景是由用户同时按压电源键和其它按键而触发的场景,语音唤醒场景是由用户长按电源键而触发人机语音交互的场景。According to the third aspect, or any implementation of the above third aspect, the specific scene includes at least a proximity light scene, a combined pressing scene, and a voice wake-up scene; wherein, the proximity light scene is caused by the screen being blocked when the electronic device is in a call state. In the triggered scene, the combined pressing scene is a scene triggered by the user pressing the power button and other buttons at the same time, and the voice wake-up scene is a scene in which the user presses the power button for a long time to trigger human-machine voice interaction.

根据第三方面,或者以上第三方面的任意一种实现方式,当计算机程序被一个或多个处理器执行时,使得电子设备执行以下步骤:在定时器的定时达到指定时长时确定第一亮灭状态和第二亮灭状态是否相同;若第一亮灭状态和第二亮灭状态相同,则确定电子设备的屏幕发生故障;若第一亮灭状态和第二亮灭状态不相同,则确定电子设备的屏幕未发生故障。According to the third aspect, or any implementation manner of the above third aspect, when the computer program is executed by one or more processors, the electronic device is made to perform the following steps: when the timing of the timer reaches the specified duration, determine the first bright Whether the off state is the same as the second on-off state; if the first on-off state and the second on-off state are the same, it is determined that the screen of the electronic device is faulty; if the first on-off state is not the same as the second on-off state, then Verify that the screen of the electronic device is not malfunctioning.

第四方面,本申请实施例提供一种电子设备。该电子设备包括:一个或多个处理器;存储器;以及一个或多个计算机程序,其中一个或多个计算机程序存储在存储器上,当计算机程序被一个或多个处理器执行时,使得电子设备执行以下步骤:响应于用户对电子设备的电源键的按压操作,启动定时器,接收到按压操作之前,电子设备处于AOD显示状态;将电源键被按压之前电子设备屏幕的亮灭状态设置为灭屏状态,并将设置后的亮灭状态作为第一亮灭状态;在定时器的定时达到指定时长时获取第二亮灭状态,第二亮灭状态是电源键被按压之后定时器的定时达到指定时长时电子设备屏幕的亮灭状态;基于第一亮灭状态和第二亮灭状态执行亮灭屏故障检测操作。In a fourth aspect, the embodiment of the present application provides an electronic device. The electronic device includes: one or more processors; memory; and one or more computer programs, wherein the one or more computer programs are stored on the memory, and when executed by the one or more processors, the electronic device Perform the following steps: start the timer in response to the user's pressing operation of the power button of the electronic device, and before receiving the pressing operation, the electronic device is in the AOD display state; set the on-off state of the screen of the electronic device before the power button is pressed to off screen status, and take the set on-off state as the first on-off state; get the second on-off state when the timing of the timer reaches the specified duration, and the second on-off state is when the power button is pressed and the timing of the timer reaches The on-off state of the screen of the electronic device for a specified time period; based on the first on-off state and the second on-off state, an on-off screen fault detection operation is performed.

根据第四方面,当计算机程序被一个或多个处理器执行时,使得电子设备执行以下步骤:响应于用户对电子设备的电源键的按下操作,直接启动定时器。According to the fourth aspect, when the computer program is executed by one or more processors, the electronic device is caused to perform the following steps: directly start the timer in response to the user pressing the power key of the electronic device.

根据第四方面,或者以上第四方面的任意一种实现方式,当计算机程序被一个或多个处理器执行时,使得电子设备执行以下步骤:响应于用户对电子设备的电源键的按压操作,确定电子设备所处场景是否为特定场景,在特定场景下接收到按压操作时,电子设备屏幕的亮灭状态不发生改变;若电子设备所处场景不是特定场景,则启动定时器。According to the fourth aspect, or any implementation manner of the above fourth aspect, when the computer program is executed by one or more processors, the electronic device is caused to perform the following steps: in response to the user pressing the power button of the electronic device, Determine whether the scene where the electronic device is located is a specific scene. When a press operation is received in a specific scene, the on-off state of the screen of the electronic device does not change; if the scene where the electronic device is not a specific scene, start a timer.

根据第四方面,或者以上第四方面的任意一种实现方式,当计算机程序被一个或多个处理器执行时,使得电子设备执行以下步骤:若电子设备所处场景为特定场景,则不执行亮灭屏故障检测操作。According to the fourth aspect, or any implementation of the above fourth aspect, when the computer program is executed by one or more processors, the electronic device is made to perform the following steps: if the scene where the electronic device is in is a specific scene, then do not execute On and off screen fault detection operation.

根据第四方面,或者以上第四方面的任意一种实现方式,特定场景至少包括接近光场景、组合按压场景和语音唤醒场景;其中,接近光场景是由电子设备处于通话状态时屏幕被遮挡而触发的场景,组合按压场景是由用户同时按压电源键和其它按键而触发的场景,语音唤醒场景是由用户长按电源键而触发人机语音交互的场景。According to the fourth aspect, or any implementation of the above fourth aspect, the specific scene includes at least a proximity light scene, a combined pressing scene, and a voice wake-up scene; wherein, the proximity light scene is caused by the screen being blocked when the electronic device is in a call state. In the triggered scene, the combined pressing scene is a scene triggered by the user pressing the power button and other buttons at the same time, and the voice wake-up scene is a scene in which the user presses the power button for a long time to trigger human-machine voice interaction.

根据第四方面,或者以上第四方面的任意一种实现方式,当计算机程序被一个或多个处理器执行时,使得电子设备执行以下步骤:确定第一亮灭状态和第二亮灭状态是否相同;若第一亮灭状态和第二亮灭状态相同,则确定电子设备的屏幕发生故障;若第一亮灭状态和第二亮灭状态不相同,则确定电子设备的屏幕未发生故障。According to the fourth aspect, or any implementation manner of the above fourth aspect, when the computer program is executed by one or more processors, the electronic device is made to perform the following steps: determine whether the first on-off state and the second on-off state are The same; if the first on-off state and the second on-off state are the same, it is determined that the screen of the electronic device is faulty; if the first on-off state is not the same as the second on-off state, it is determined that the screen of the electronic device is not faulty.

第五方面,本申请实施例提供一种芯片。该芯片包括一个或多个接口电路和一个或多个处理器;接口电路用于从电子设备的存储器接收信号,并向处理器发送信号,信号包括存储器中存储的计算机指令;当处理器执行计算机指令时,使得电子设备执行权利第一方面和第二方面以及第一方面和第二方面中任意一项的故障检测方法。In a fifth aspect, the embodiment of the present application provides a chip. The chip includes one or more interface circuits and one or more processors; the interface circuit is used to receive signals from the memory of the electronic device and send signals to the processor, the signals include computer instructions stored in the memory; when the processor executes the computer When the instruction is used, the electronic device is made to execute the fault detection method of the first aspect and the second aspect and any one of the first aspect and the second aspect.

第五方面以及第五方面的任意一种实现方式分别与第一方面以及第一方面的任意一种实现方式相对应。第五方面以及第五方面的任意一种实现方式所对应的技术效果可参见上述第一方面和第二方面以及第一方面和第二方面的任意一种实现方式所对应的技术效果,此处不再赘述。The fifth aspect and any implementation manner of the fifth aspect correspond to the first aspect and any implementation manner of the first aspect respectively. For the technical effects corresponding to the fifth aspect and any implementation of the fifth aspect, please refer to the above-mentioned first aspect and the second aspect and the technical effects corresponding to any implementation of the first aspect and the second aspect, here No longer.

第六方面,本申请实施例提供一种计算机可读存储介质。该计算机可读存储介质包括计算机程序,其特征在于,当计算机程序在电子设备上运行时,使得电子设备执行第一方面和第二方面以及第一方面和第二方面中任意一项故障检测方法。In a sixth aspect, the embodiments of the present application provide a computer-readable storage medium. The computer-readable storage medium includes a computer program, which is characterized in that, when the computer program is run on the electronic device, the electronic device is made to execute the fault detection method of any one of the first aspect and the second aspect and the first aspect and the second aspect .

第六方面以及第六方面的任意一种实现方式分别与第一方面和第二方面以及第一方面和第二方面的任意一种实现方式相对应。第六方面以及第六方面的任意一种实现方式所对应的技术效果可参见上述第一方面和第二方面以及第一方面和第二方面的任意一种实现方式所对应的技术效果,此处不再赘述。The sixth aspect and any implementation manner of the sixth aspect correspond to the first aspect and the second aspect and any implementation manner of the first aspect and the second aspect respectively. For the technical effects corresponding to the sixth aspect and any implementation of the sixth aspect, please refer to the above-mentioned first aspect and the second aspect and the technical effects corresponding to any implementation of the first and second aspects, here No longer.

附图说明Description of drawings

图1a~1b为本申请实施例提供的一种应用场景示意图;Figures 1a-1b are schematic diagrams of an application scenario provided by the embodiment of the present application;

图2a~2b为本申请实施例提供的另一应用场景示意图;2a-2b are schematic diagrams of another application scenario provided by the embodiment of the present application;

图3a~3c为本申请实施例提供的桌面模式切换至AOD模式的示意图;3a-3c are schematic diagrams of switching from the desktop mode to the AOD mode provided by the embodiment of the present application;

图4a~4b为本申请实施例提供的AOD模式切换至锁屏模式的示意图;4a-4b are schematic diagrams of switching from the AOD mode to the lock screen mode provided by the embodiment of the present application;

图5为本申请实施例示出的电子设备的结构示意图;FIG. 5 is a schematic structural diagram of an electronic device shown in an embodiment of the present application;

图6为本申请实施例示出的电子设备的软件结构示意图;FIG. 6 is a schematic diagram of a software structure of an electronic device shown in an embodiment of the present application;

图7为一实施例提供的一种故障检测方法的流程示意图;FIG. 7 is a schematic flowchart of a fault detection method provided by an embodiment;

图8为本申请一实施例提供的一种故障检测方法的流程示意图;FIG. 8 is a schematic flowchart of a fault detection method provided by an embodiment of the present application;

图9为本申请实施例提供的故障检测方法的中亮灭屏故障检测操作的流程示意图;FIG. 9 is a schematic flowchart of a fault detection operation of a fault detection method with the screen on and off in the fault detection method provided by the embodiment of the present application;

图10为本申请另一实施例提供的一种故障检测方法的流程示意图;FIG. 10 is a schematic flowchart of a fault detection method provided by another embodiment of the present application;

图11为本申请实施例提供的故障检测方法中电子设备从亮灭态到灭屏态的示例图;FIG. 11 is an example diagram of an electronic device from the on-off state to the off-screen state in the fault detection method provided by the embodiment of the present application;

图12为本申请又一实施例提供的一种故障检测方法的流程示意图;FIG. 12 is a schematic flowchart of a fault detection method provided in another embodiment of the present application;

图13为本申请实施例提供的故障检测方法中电子设备从灭屏态到亮屏态的示例图。FIG. 13 is an example diagram of an electronic device from a screen-off state to a screen-on state in the fault detection method provided by the embodiment of the present application.

具体实施方式Detailed ways

下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of them. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of this application.

应当理解,当在本申请说明书和所附权利要求书中使用时,术语“包括”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。It should be understood that when used in this specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and/or components, but does not exclude one or more other Presence or addition of features, wholes, steps, operations, elements, components and/or collections thereof.

还应当理解,在本申请实施例中,“一个或多个”是指一个、两个或两个以上;“和/或”,描述关联对象的关联关系,表示可以存在三种关系;例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A、B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。It should also be understood that in the embodiments of the present application, "one or more" refers to one, two or more than two; "and/or" describes the association relationship of associated objects, indicating that there may be three types of relationships; for example, A and/or B may mean: A exists alone, A and B exist simultaneously, and B exists alone, wherein A and B may be singular or plural. The character "/" generally indicates that the contextual objects are an "or" relationship.

本申请实施例的说明书和权利要求书中的术语“第一”和“第二”等是用于区别不同的对象,而不是用于描述对象的特定顺序。例如,第一目标对象和第二目标对象等是用于区别不同的目标对象,而不是用于描述目标对象的特定顺序。The terms "first" and "second" in the description and claims of the embodiments of the present application are used to distinguish different objects, rather than to describe a specific order of objects. For example, the first target object, the second target object, etc. are used to distinguish different target objects, rather than describing a specific order of the target objects.

在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。Reference to "one embodiment" or "some embodiments" or the like in the specification of the present application means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in other embodiments," etc. in various places in this specification are not necessarily All refer to the same embodiment, but mean "one or more but not all embodiments" unless specifically stated otherwise. The terms "including", "comprising", "having" and variations thereof mean "including but not limited to", unless specifically stated otherwise.

在本申请实施例的描述中,除非另有说明,“多个”的含义是指两个或两个以上。例如,多个处理单元是指两个或两个以上的处理单元;多个系统是指两个或两个以上的系统。In the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more. For example, multiple processing units refer to two or more processing units; multiple systems refer to two or more systems.

如图1a~1b为示例性的示出一种应用场景示意图,请参照图1a,电子设备的屏幕处于亮屏状态时,如果用户按压电源键101,则电子设备屏幕的状态从图1a切换至图1b,图1b为灭屏状态。电子设备的屏幕未发生故障,且屏幕处于亮屏状态时,只要用户按压电源键101,则电子设备的屏幕便可以从图1a的亮屏状态切换至图1b的灭屏状态。其中,按压电源键可以是按下并抬起电源键。Figures 1a-1b are exemplary schematic diagrams showing an application scenario. Please refer to Figure 1a. When the screen of the electronic device is in the bright state, if the user presses the power button 101, the state of the screen of the electronic device switches from Figure 1a to Figure 1b, Figure 1b is the off-screen state. When the screen of the electronic device is not faulty and the screen is on, as long as the user presses the power button 101, the screen of the electronic device can be switched from the on-screen state of FIG. 1a to the off-screen state of FIG. 1b. Wherein, pressing the power key may be pressing and lifting the power key.

另外,如果电子设备在亮屏状态时发生亮灭屏故障,用户按压电源键101,电子设备的屏幕无法从图1a切换至图1b。换句话说,在电子设备的屏幕发生故障时,若用户按压电源键101,则屏幕的状态保持在图1a不变。In addition, if the screen of the electronic device fails to turn on or off when the screen is on, and the user presses the power button 101, the screen of the electronic device cannot be switched from FIG. 1a to FIG. 1b. In other words, when the screen of the electronic device fails, if the user presses the power button 101, the state of the screen remains unchanged as shown in FIG. 1a.

如图2a~2b为示例性的示出另一种应用场景示意图,请参照图2a,电子设备的屏幕处于灭屏状态时,如果用户按压电源键101,则电子设备屏幕的状态可以从图2a切换至图2b,图2b为亮屏状态。因此,电子设备的屏幕未发生故障,且屏幕处于灭屏状态时,只要用户按压电源键101,则电子设备的屏幕便可以从图2a的灭屏状态切换至图2b的亮屏状态。Figures 2a-2b are exemplary schematic diagrams showing another application scenario, please refer to Figure 2a, when the screen of the electronic device is in the off-screen state, if the user presses the power button 101, the state of the screen of the electronic device can be changed from Figure 2a Switch to Figure 2b, Figure 2b is the bright screen state. Therefore, when the screen of the electronic device is not faulty and the screen is in the off-screen state, as long as the user presses the power button 101, the screen of the electronic device can be switched from the off-screen state in FIG. 2a to the on-screen state in FIG. 2b.

另外,如果电子设备在灭屏状态时发生亮灭屏故障,用户按压电源键101,电子设备的屏幕则无法从图2a切换至图2b。换句话说,在电子设备的屏幕发生故障时,若用户按压电源键101,则屏幕的状态保持在图2a不变。In addition, if the electronic device is in the off-screen state and the screen fails to turn on and off, and the user presses the power button 101, the screen of the electronic device cannot be switched from FIG. 2a to FIG. 2b. In other words, when the screen of the electronic device fails, if the user presses the power button 101, the state of the screen remains unchanged in FIG. 2a.

因此,为了准确的对亮灭屏的进行故障检测,在检测到用户对电子设备的电源键101执行按压操作的时,可以获取执行按压操作之前屏幕的第一亮灭状态和执行按压操作之后屏幕的第二亮灭状态。Therefore, in order to accurately detect the failure of the on-off screen, when it is detected that the user performs a press operation on the power key 101 of the electronic device, the first on-off state of the screen before the press operation and the first on-off state of the screen after the press operation can be obtained. The second on and off state of .

其中,第二亮灭状态是在接收到按压操作后的第一指定时长后时获取的。例如,在检测到按压操作后的第6s获取第二亮灭状态。在此基础上,确定第一亮灭状态和第二亮灭状态是否相同,若第一亮灭状态和第二亮灭状态相同,则确定电子设备的屏幕发生故障,否则确定手机的屏幕未发生故障。然而,在一些特定场景下,即使触发按压操作,电子设备的屏幕亮灭状态也可能不发生改变,此时如果输出故障或者记录故障日志,则会造成故障的误报,进而影响用户的使用体验。Wherein, the second on-off state is acquired after a first specified period of time after the press operation is received. For example, the second on-off state is acquired at 6s after the press operation is detected. On this basis, determine whether the first on-off state and the second on-off state are the same, if the first on-off state is the same as the second on-off state, then determine that the screen of the electronic device has failed, otherwise determine that the screen of the mobile phone has not failed. Fault. However, in some specific scenarios, even if the pressing operation is triggered, the on-off state of the screen of the electronic device may not change. At this time, if a fault is output or a fault log is recorded, it will cause a false alarm of the fault and affect the user experience. .

本申请实施例中所涉及的故障检测可以在电子设备的任意模式下触发。本申请实施例中的电子设备模式包括但不限于:息屏模式、锁屏模式与桌面模式以及AOD(Always onDisplay,息屏显示)模式等。The fault detection involved in the embodiments of the present application may be triggered in any mode of the electronic device. The modes of the electronic device in the embodiment of the present application include, but are not limited to: an always-on display mode, a lock-screen mode, a desktop mode, and an AOD (Always on Display, always on display) mode.

示例性的,桌面模式即为电子设备解锁后的模式,如图1a所示。示例性的,用户可在桌面模式下对电子设备进行操作,以使用电子设备提供的相应功能。例如,用户可使用聊天应用、视频应用、通话、观看视频等。Exemplarily, the desktop mode is the mode after the electronic device is unlocked, as shown in FIG. 1a. Exemplarily, the user can operate the electronic device in desktop mode to use corresponding functions provided by the electronic device. For example, a user may use a chat application, a video application, make a call, watch a video, and so on.

在桌面模式下,接收到用户对电源键的按压操作后,在正常的情况下,电子设备可以从亮屏界面切换至息屏界面,如图1a和图1b所示。反之,在异常情况下,电子设备的当前界面可能会保持亮屏界面不变。另外,桌面模式也可以称作是非锁屏模式,该桌面模式既可以包括桌面使用场景,也可以包括应用程序使用场景。In the desktop mode, after receiving the user's pressing operation on the power button, under normal circumstances, the electronic device can switch from the screen-on interface to the screen-off interface, as shown in Fig. 1a and Fig. 1b. Conversely, under abnormal circumstances, the current interface of the electronic device may keep the bright screen interface unchanged. In addition, the desktop mode can also be referred to as a non-lock screen mode, and the desktop mode can include not only desktop usage scenarios, but also application program usage scenarios.

示例性的,息屏模式可选地为电子设备在接收到用户点击开机键即电源键(Power键)后所进入的模式,如图2a所示。电子设备处于息屏模式下时,接收到用户对电源键的触控操作,正常情况下,电子设备可以从灭屏界面切换至亮屏界面。反之,在异常情况下,电子设备的当前界面可能会保持息屏界面不变。Exemplarily, the screen-off mode may optionally be a mode that the electronic device enters after receiving a user's click on a power button, that is, a power button (Power button), as shown in FIG. 2a. When the electronic device is in the off-screen mode, it receives a user's touch operation on the power button, and under normal circumstances, the electronic device can switch from the screen-off interface to the screen-on interface. Conversely, under abnormal circumstances, the current interface of the electronic device may keep the screen-off interface unchanged.

示例性的,锁屏模式可选地为电子设备的屏幕锁定,如图2b所示。示例性的,在息屏模式下,用户对电子设备进行触摸或按键等操作,可使得电子设备进入锁屏模式。示例性的,锁屏模式将屏幕锁定,需要用户进行解锁后才能进入桌面模式。Exemplarily, the lock screen mode may optionally be a screen lock of the electronic device, as shown in FIG. 2b. Exemplarily, in the screen-off mode, the user can make the electronic device enter the lock-screen mode by performing operations such as touching or pressing keys on the electronic device. Exemplarily, the lock screen mode locks the screen, and the user needs to unlock it before entering the desktop mode.

示例性的,锁屏模式可提供一些不需要解锁即可使用的功能,例如拍照功能、小工具等。也就是说,锁屏模式下用户可对电子设备进行相应的操作,而在息屏模式下,当用户按压所述电子设备的电源键,则电子设备将进入到锁屏模式。电子设备锁屏模式下,接收到用户对电源键的触控操作后,在电子设备正常的情况下,电子设备切换至息屏界面。在电子设备异常的情况下,保持锁屏界面不变。Exemplarily, the lock screen mode may provide some functions that can be used without unlocking, such as a camera function, gadgets, and the like. That is to say, the user can perform corresponding operations on the electronic device in the lock screen mode, and in the off-screen mode, when the user presses the power button of the electronic device, the electronic device will enter the lock screen mode. In the lock screen mode of the electronic device, after receiving a user's touch operation on the power button, the electronic device switches to an off-screen interface when the electronic device is normal. When the electronic device is abnormal, keep the lock screen interface unchanged.

示例性的,AOD模式,是指电子设备息屏时,显示屏的部分区域保持常亮或者显示屏检测到触屏操作时部分区域亮起的一种显示模式。其中,设置AOD模式的电子设备,在将要息屏时,会由显示亮屏界面直接切换至显示AOD界面,在将要亮屏时,会由显示AOD界面直接切换至显示锁屏界面。另外,在将要息屏时,电子设备也可以先由显示亮屏界面切换至息屏界面,再由息屏界面切换至AOD界面。Exemplarily, the AOD mode refers to a display mode in which when the screen of the electronic device is turned off, some areas of the display screen remain always on, or some areas of the display screen light up when a touch screen operation is detected. Among them, the electronic device set in AOD mode will directly switch from displaying the bright screen interface to displaying the AOD interface when the screen is about to be turned off, and will directly switch from displaying the AOD interface to displaying the lock screen interface when the screen is about to be turned on. In addition, when the screen is about to be turned off, the electronic device may first switch from displaying the on-screen interface to the off-screen interface, and then switch from the off-screen interface to the AOD interface.

在一些实施方式中,设置AOD模式的电子设备(如手机)在息屏状态下,可以显示AOD界面,此时电子设备所处场景为AOD场景。其中,息屏状态可以是指电子设备屏幕完全不点亮的状态。AOD可以称之为息屏显示或灭屏显示,对此不做限定。下述以手机为例进行解释说明。In some implementations, an electronic device (such as a mobile phone) set to an AOD mode may display an AOD interface when the screen is off. At this time, the scene where the electronic device is located is an AOD scene. Wherein, the off-screen state may refer to a state in which the screen of the electronic device is not turned on at all. The AOD may be called an on-screen display or an off-screen display, which is not limited. The following uses a mobile phone as an example for explanation.

示例性的,手机在进行AOD时,可以显示时间、日期、电量等信息,也可以显示动画,如图3a~3c所示。图3a~3c为AOD场景示意图。电子设备在显示任意界面时,当用户按下电源键101时,电子设备进入息屏状态。若电子设备AOD模式处于打开状态,电子设备息屏后即可显示AOD界面。Exemplarily, when the mobile phone is performing AOD, it may display information such as time, date, and power, and may also display animation, as shown in FIGS. 3a-3c. 3a-3c are schematic diagrams of AOD scenarios. When the electronic device is displaying any interface, when the user presses the power button 101, the electronic device enters a screen-off state. If the AOD mode of the electronic device is turned on, the AOD interface can be displayed after the screen of the electronic device is turned off.

示例性的,在电子设备处于如图3a所示桌面模式时,用户按下电源键101,此时电子设备可以进入如图3b所示的息屏状态,然后显示如图3c所示的AOD界面。另外,电子设备在显示AOD界面时,当用户按下电源键,手机退出AOD界面,进入亮屏状态。Exemplarily, when the electronic device is in the desktop mode as shown in Figure 3a, the user presses the power button 101, at this time the electronic device can enter the off-screen state as shown in Figure 3b, and then display the AOD interface as shown in Figure 3c . In addition, when the electronic device is displaying the AOD interface, when the user presses the power button, the mobile phone exits the AOD interface and enters a bright screen state.

需要说明的是,在电子设备处于如图3a所示的桌面模式时,用户按下电源键后电子设备也可以直接进入如图3c所示的AOD界面。It should be noted that, when the electronic device is in the desktop mode as shown in FIG. 3a, the electronic device may directly enter the AOD interface as shown in FIG. 3c after the user presses the power button.

作为另一个示例,在电子设备处于AOD界面时,如果检测到用户按下电源键101,则电子设备的显示界面可以从AOD界面切换至锁屏界面,详细如图4a~4b所示。电子设备处于如图4a所示的AOD界面时,如果检测到用户按下电源键101,则电子设备进入锁屏模式,即显示图4b所示的锁屏界面。As another example, when the electronic device is in the AOD interface, if it is detected that the user presses the power button 101, the display interface of the electronic device may be switched from the AOD interface to the lock screen interface, as shown in Figures 4a-4b in detail. When the electronic device is in the AOD interface shown in FIG. 4a, if it is detected that the user presses the power button 101, the electronic device enters the lock screen mode, that is, displays the lock screen interface shown in FIG. 4b.

通过图4a~4b可以知道,电子设备处于亮屏状态,且AOD模式处于打开状态时,如果检测到用户按压电子设备的电源键101,则电子设备首先从AOD模式切换至锁屏模式。It can be known from Fig. 4a-4b that when the electronic device is in the bright screen state and the AOD mode is in the open state, if it is detected that the user presses the power button 101 of the electronic device, the electronic device first switches from the AOD mode to the lock screen mode.

通过上述介绍可以知道,在接收到按压操作时,电子设备可以获取第一亮灭状态和第二亮灭状态,其中,第一亮灭状态为亮屏状态。From the above introduction, it can be known that when receiving a press operation, the electronic device can obtain the first on-off state and the second on-off state, wherein the first on-off state is the on-screen state.

另外,第二亮灭状态可以是在接收到按压操作后的第一指定时长后获取的。然而,当达到第一指定时长后电子设备显示的界面为AOD界面,故第二亮灭状态为亮屏状态。可见,此时的第一亮灭状态和第二亮灭状态相同。因此利用上述故障检测方法进行亮灭屏故障检测操作便会出现故障误检测的问题。In addition, the second on-off state may be acquired after a first specified period of time after the press operation is received. However, the interface displayed by the electronic device is the AOD interface when the first specified time period is reached, so the second on-off state is the on-screen state. It can be seen that the first on-off state and the second on-off state at this time are the same. Therefore, using the above fault detection method to perform the on-off screen fault detection operation will cause the problem of false detection of faults.

作为一个示例,如图3a~3c所示,电子设备处于桌面界面(第一亮灭状态为亮屏)时,检测到用户按压电源键,电子设备从亮屏状态切换至灭屏状态。而后由于AOD模式处于打开状态,故在1s后电子设备又可以从灭屏状态切换至亮屏状态(AOD界面)。电子设备在6s后获取到的第二亮灭状态为亮屏状态。可以看出,此时的亮灭状态变化是正常情况,然而根据上述故障检测方法,会检测出亮灭屏出现故障,进而导致误检率提高。As an example, as shown in FIGS. 3a to 3c, when the electronic device is on the desktop interface (the first on-off state is the on-screen), it is detected that the user presses the power button, and the electronic device switches from the on-screen state to the off-screen state. Then, since the AOD mode is on, the electronic device can be switched from the off-screen state to the on-screen state (AOD interface) after 1 second. The second on-off state obtained by the electronic device after 6s is the on-screen state. It can be seen that the change of the on-off state at this time is normal. However, according to the above fault detection method, a fault will be detected on the on-off screen, which will lead to an increase in the false detection rate.

作为一个示例,如图4a~4b所示,电子设备处于AOD界面(第一亮灭屏状态为亮屏)时,检测到用户按压电源键,电子设备从亮屏状态切换至锁屏界面(第二亮灭状态为灭屏)。可以看出,此时的亮灭状态变化是正常情况,然而根据上述故障检测方法,会检测出亮灭屏出现故障,进而导致误检率提高。As an example, as shown in Figures 4a to 4b, when the electronic device is in the AOD interface (the first on-off screen state is the bright screen), it is detected that the user presses the power button, and the electronic device switches from the bright screen state to the lock screen interface (the first on-off screen state is the bright screen). Two light off state is off screen). It can be seen that the change of the on-off state at this time is normal. However, according to the above fault detection method, a fault will be detected on the on-off screen, which will lead to an increase in the false detection rate.

为了解决上述问题,本申请实施例提供了一种故障检测方法。该故障检测方法中,在电子设备的AOD模式处于打开状态的情况下,如果检测到用户针对电源键输入了按压操作,则通过强制设置亮灭屏的状态可以保证故障检测的准确性,进而可以降低故障的误检率。In order to solve the above problem, an embodiment of the present application provides a fault detection method. In this fault detection method, when the AOD mode of the electronic device is in the open state, if it is detected that the user has input a pressing operation on the power button, the accuracy of fault detection can be ensured by forcibly setting the state of the screen on and off, and then the Reduce the false detection rate of faults.

本申请实施例中的故障检测方法可应用于如图5所示的电子设备中,图5所示的电子设备100可以为终端,也可以称为终端设备,终端可以为蜂窝电话(cellularphone),平板电脑(pad)、可穿戴设备或物联网设备等具有摄像头的设备,本申请不做限定。需要说明的是,电子设备100的结构示意图可以适用于图1a至图4b中的手机/电子设备。The fault detection method in the embodiment of the present application can be applied to an electronic device as shown in FIG. 5. The electronic device 100 shown in FIG. 5 can be a terminal, or can be called a terminal device, and the terminal can be a cellular phone. Devices with a camera such as a tablet computer (pad), a wearable device, or an Internet of Things device are not limited in this application. It should be noted that the schematic structural diagram of the electronic device 100 may be applicable to the mobile phone/electronic device shown in FIG. 1a to FIG. 4b.

进一步需要说明的是,电子设备100可以具有比图中所示的更多的或者更少的部件,可以组合两个或多个的部件,或者可以具有不同的部件配置。图5中所示出的各种部件可以在包括一个或多个信号处理和/或专用集成电路在内的硬件、软件、或硬件和软件的组合中实现。It should be further noted that the electronic device 100 may have more or fewer components than those shown in the figure, may combine two or more components, or may have different configurations of components. The various components shown in Figure 5 may be implemented in hardware, software, or a combination of hardware and software including one or more signal processing and/or application specific integrated circuits.

电子设备100可以包括:处理器110,外部存储器接口120,内部存储器121,通用串行总线(universalserialbus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriberidentificationmodule,SIM)卡接口195等。其中传感器模块180可以包括压力传感器,陀螺仪传感器,气压传感器180,磁传感器180,加速度传感器,距离传感器,接近光传感器,指纹传感器180,温度传感器180,触摸传感器,环境光传感器180,骨传导传感器180等。The electronic device 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universalserialbus, USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, Mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone jack 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display screen 194, and user An identification module (subscriber identification module, SIM) card interface 195 and the like. The sensor module 180 may include a pressure sensor, a gyroscope sensor, an air pressure sensor 180, a magnetic sensor 180, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor 180, a temperature sensor 180, a touch sensor, an ambient light sensor 180, and a bone conduction sensor. 180 etc.

可以理解的是,本发明实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that, the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100 . In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine certain components, or separate certain components, or arrange different components. The illustrated components can be realized in hardware, software or a combination of software and hardware.

处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(applicationprocessor,AP),调制解调处理器,图形处理器(graphicsprocessingunit,GPU),图像信号处理器(imagesignalprocessor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digitalsignalprocessor,DSP),基带处理器,和/或神经网络处理器(neural-networkprocessingunit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural network processor (neural-network processing unit, NPU), etc. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.

其中,控制器可以是电子设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。Wherein, the controller may be the nerve center and command center of the electronic device 100 . The controller can generate an operation control signal according to the instruction opcode and timing signal, and complete the control of fetching and executing the instruction.

处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。USB接口130是符合USB标准规范的接口,具体可以是MiniUSB接口,MicroUSB接口,USBTypeC接口等。USB接口130可以用于连接充电器为电子设备100充电,也可以用于电子设备100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他电子设备,例如AR设备等。A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. The USB interface 130 is an interface conforming to the USB standard specification, specifically, it may be a MiniUSB interface, a MicroUSB interface, a USB Type C interface, and the like. The USB interface 130 can be used to connect a charger to charge the electronic device 100 , and can also be used to transmit data between the electronic device 100 and peripheral devices. It can also be used to connect headphones and play audio through them. This interface can also be used to connect other electronic devices, such as AR devices.

天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 may be used to cover single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example: Antenna 1 can 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.

移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(lownoiseamplifier,LNA)等。无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wirelesslocalareanetworks,WLAN)(如无线保真(wirelessfidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(globalnavigationsatellitesystem,GNSS),调频(frequencymodulation,FM),近距离无线通信技术(nearfieldcommunication,NFC),红外技术(infrared,IR)等无线通信的解决方案。The mobile communication module 150 can provide wireless communication solutions including 2G/3G/4G/5G applied on the electronic device 100 . The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA) and the like. The wireless communication module 160 can provide applications on the electronic device 100 including wireless local area networks (wireless local area networks, WLAN) (such as wireless fidelity (wireless fidelity, Wi-Fi) network), bluetooth (bluetooth, BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication technology (nearfield communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions.

在一些实施例中,电子设备100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备100可以通过无线通信技术与网络以及其他设备通信。In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology.

电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 100 realizes the display function through 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 the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquidcrystaldisplay,LCD),有机发光二极管(organiclight-emittingdiode,OLED)。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。The display screen 194 is used to display images, videos and the like. The display screen 194 includes a display panel. The display panel may be a liquid crystal display (liquid crystal display, LCD) or an organic light-emitting diode (organic light-emitting diode, OLED). In some embodiments, the electronic device 100 may include 1 or N display screens 194 , where N is a positive integer greater than 1.

外部存储器接口120可以用于连接外部存储卡,例如MicroSD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。The external memory interface 120 can be used to connect an external memory card, such as a MicroSD card, to expand the storage capacity of the electronic device 100 . The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. Such as saving music, video and other files in the external memory card.

内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行电子设备100的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。The internal memory 121 may be used to store computer-executable program codes including instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by executing instructions stored in the internal memory 121 . The internal memory 121 may include an area for storing programs and an area for storing data.

电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。The electronic device 100 can implement audio functions through the audio module 170 , the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. Such as music playback, recording, etc.

音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into 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 set in the processor 110 , or some functional modules of the audio module 170 may be set in the processor 110 .

压力传感器用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器可以设置于显示屏194。压力传感器的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。The pressure sensor is used to sense the pressure signal and convert the pressure signal into an electrical signal. In some embodiments, a pressure sensor may be located on the display screen 194 . There are many types of pressure sensors, such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities may correspond to different operation instructions.

接近光传感器可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。电子设备100通过发光二极管向外发射红外光。电子设备100使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定电子设备100附近有物体。当检测到不充分的反射光时,电子设备100可以确定电子设备100附近没有物体。电子设备100可以利用接近光传感器检测用户手持电子设备100贴近耳朵通话,以便自动熄灭屏幕达到省电的目的。接近光传感器也可用于皮套模式,口袋模式自动解锁与锁屏。Proximity light sensors may include, for example, light emitting diodes (LEDs) and light detectors, such as photodiodes. The light emitting diodes may be infrared light emitting diodes. The electronic device 100 emits infrared light through the light emitting diode. Electronic device 100 uses photodiodes to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it may be determined that there is an object near the electronic device 100 . When insufficient reflected light is detected, the electronic device 100 may determine that there is no object near the electronic device 100 . The electronic device 100 can use the proximity light sensor to detect that the user holds the electronic device 100 close to the ear to make a call, so as to automatically turn off the screen to save power. Proximity light sensor can also be used for leather case mode, pocket mode auto unlock and lock screen.

触摸传感器,也称“触控面板”。触摸传感器可以设置于显示屏194,由触摸传感器与显示屏194组成触摸屏,也称“触控屏”。触摸传感器用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器也可以设置于电子设备100的表面,与显示屏194所处的位置不同。Touch sensor, also known as "touch panel". The touch sensor can be arranged on the display screen 194, and the touch sensor and the display screen 194 form a touch screen, also called “touch screen”. The touch sensor is used to detect a touch operation on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194 . In some other embodiments, the touch sensor can also be disposed on the surface of the electronic device 100 , which is different from the position of the display screen 194 .

按键190包括开机键(或称电源键),音量键等。按键190可以是机械按键。也可以是触摸式按键。电子设备100可以接收按键输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入。其中,按下电源键可以使手机息屏或亮屏。The buttons 190 include a power button (or called a power button), a volume button, and the like. The key 190 may be a mechanical key. It can also be a touch button. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100 . Among them, pressing the power button can turn off or brighten the screen of the mobile phone.

电子设备100的分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Androidruntime)和系统库,以及内核层。The layered architecture of the electronic device 100 divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate through software interfaces. In some embodiments, the Android system is divided into four layers, which are respectively the application program layer, the application program framework layer, the Android runtime (Android runtime) and the system library, and the kernel layer from top to bottom.

应用程序层可以包括一系列应用程序包。The application layer can consist of a series of application packages.

如图6所示,应用程序层可以包括相机,图库,日历,通话,地图,WLAN,蓝牙,音乐,视频,短信息等应用程序。As shown in Figure 6, the application layer may include applications such as camera, gallery, calendar, call, map, WLAN, Bluetooth, music, video, and short message.

应用程序框架层为应用程序层的应用程序提供应用编程接口(applicationprogramminginterface,API)和编程框架。应用程序框架层包括一些预先定义的函数。如图6所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。The application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions. As shown in Figure 6, the application framework layer may include a window manager, content provider, view system, phone manager, resource manager, notification manager, etc.

内核层是硬件和上述软件层之间的层。内核层至少包含显示设置模块、传感器驱动、场景判断模块、面板设置模块以及亮灭屏故障检测操作模块。其中,该硬件可以包括摄像头、显示屏,麦克风,处理器,以及存储器等器件。The kernel layer is a layer between the hardware and the software layers mentioned above. The kernel layer includes at least a display setting module, a sensor driver, a scene judgment module, a panel setting module, and an on-off screen fault detection operation module. Wherein, the hardware may include devices such as a camera, a display screen, a microphone, a processor, and a memory.

其中,显示设置模块用于对电子设备当前显示的内容进行设置。另外,面板设置模块用于对显示屏的亮灭状态进行设置。Wherein, the display setting module is used to set the content currently displayed by the electronic device. In addition, the panel setting module is used to set the on-off state of the display screen.

场景判断模块用于确定电子设备当前所处场景以及电子设备的亮灭状态等。作为一个示例,场景判断模块用于确定电子设备当前是否处于亮屏/灭屏状态,以及确定电子设备的AOD模式是否处于打开状态。The scene judging module is used to determine the current scene of the electronic device and the on-off state of the electronic device. As an example, the scene judging module is used to determine whether the electronic device is currently in a screen on/off state, and determine whether the AOD mode of the electronic device is in an on state.

亮灭屏故障检测操作模块用于判断电子设备的亮灭屏是否发生故障,具体的,在检测到用户对电源键执行按压操作后,亮灭屏故障检测操作模块可以基于按压操作前后亮灭屏的状态确定电子设备是否发生故障。The on-off screen failure detection operation module is used to determine whether the on-off screen of the electronic device is faulty. Specifically, after detecting that the user presses the power button, the on-off screen failure detection operation module can turn on and off the screen based on the pressing operation The status of the electronic device determines whether it is malfunctioning.

传感器驱动用于接收各传感器采集的数据,并将这些数据发送至场景判断模块。例如,传感器驱动可以接收接近光传感器发采集到的相关数据,并将这些数据传输至场景判断模块。The sensor driver is used to receive the data collected by each sensor and send the data to the scene judgment module. For example, the sensor driver can receive relevant data collected by the proximity light sensor, and transmit the data to the scene judgment module.

可以理解的是,图6示出的应用程序框架层、系统库与运行时层等包含的部件,并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。It can be understood that the components included in the application framework layer, system library, and runtime layer shown in FIG. 6 do not constitute a specific limitation on the electronic device 100 . In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine certain components, or separate certain components, or arrange different components.

电子设备的AOD模式在处于打开状态时,如果检测到用户基于电源键输入按压操作,在执行按压操作前后获取的亮灭状态可能相同。具体的,电子设备在处于桌面模式时第一亮灭状态为亮屏状态,检测到用户针对电源键输入按压操作后,启动定时器。在定时达到第一指定时长时获取第二亮灭状态,由于定时达到第一指定时长时电子设备处于AOD界面,故此时的第二亮灭状态为亮屏状态。此种情况为电子设备的AOD功能的正常体现,然而通过上述检测方法会确定出电子设备的亮灭屏存在故障。When the AOD mode of the electronic device is in an on state, if it is detected that the user inputs a press operation based on the power key, the on-off state obtained before and after the press operation may be the same. Specifically, when the electronic device is in the desktop mode, the first on-off state is the on-screen state, and after detecting that the user inputs a pressing operation on the power button, the timer is started. The second on-off state is acquired when the timing reaches the first specified duration. Since the electronic device is in the AOD interface when the timing reaches the first specified duration, the second on-off state at this time is the on-screen state. This situation is a normal manifestation of the AOD function of the electronic device. However, the above detection method will determine that there is a fault in the on-off screen of the electronic device.

作为一个示例,如图7所示,电子设备在处于亮屏状态时,检测到电源键被按压,即电源键接收到用户输入的按压操作时,一方面电源键可以向亮灭屏故障检测操作模块发送亮灭屏故障检测操作请求,另一方面可以向显示设置模块发送灭屏请求。电源键可以先将灭屏请求发送至显示设置模块,然后再将亮灭屏故障检测操作请求发送至亮灭屏故障检测操作模块,或者也可以先将亮灭屏故障检测操作请求发送至亮灭屏故障检测操作模块,然后再将灭屏请求发送至显示设置模块。As an example, as shown in Figure 7, when the electronic device is in the bright screen state, it detects that the power key is pressed, that is, when the power key receives a pressing operation input by the user, on the one hand, the power key can turn on and off the screen fault detection operation The module sends a fault detection operation request for turning on and off the screen, and on the other hand, it can send a request for turning off the screen to the display setting module. The power button can first send the off-screen request to the display setting module, and then send the on-off screen fault detection operation request to the on-off screen fault detection operation module, or can first send the on-off screen fault detection operation request to the on-off screen fault detection operation module. Screen fault detection operation module, and then send the screen off request to the display setting module.

可选的,电源键也可以同时将亮灭屏故障检测操作请求和灭屏请求分别发送至亮灭屏故障检测操作模块和显示设置模块。其中,亮灭屏故障检测操作请求和灭屏请求发送的先后顺序不做限定,可以根据实际情况进行选择。Optionally, the power button can also simultaneously send the on-off screen fault detection operation request and the screen-off request to the on-off screen fault detection operation module and the display setting module respectively. Wherein, there is no limitation on the sequence of sending the screen-on-off fault detection operation request and the screen-off request, which can be selected according to the actual situation.

显示设置模块在接收到灭屏请求时首先可以将亮灭屏的状态设置为0,即灭屏状态。然而由于AOD模式的开启,电子设备在灭屏后的第二指定时长后会从灭屏状态切换至状态。如图7所示,显示设置模块在接收到灭屏请求后,其可以判断AOD是否显示完整,若确定AOD显示完整,则显示设置模块可以将亮灭屏的状态设置为非0,即亮屏状态。When the display setting module receives the request to turn off the screen, it can first set the state of the on and off screen to 0, that is, the state of the off screen. However, due to the opening of the AOD mode, the electronic device will switch from the off-screen state to the off-screen state after a second specified time period after the screen is off. As shown in Figure 7, after the display setting module receives the off-screen request, it can judge whether the AOD display is complete. If it is determined that the AOD display is complete, the display setting module can set the state of the on-off screen to non-zero, that is, on-screen state.

需要说明的是,面板设置模块在将电子设备的亮灭状态设置为0之前,其可以获取按压操作之前电子设备的第一亮灭状态,并将第一亮灭状态预先发送至亮灭屏故障检测操作模块。换句话说,在定时器启动之前,本申请实施例可以预先将第一亮灭状态存储在亮灭屏故障检测操作模块,以方便执行后续的亮灭屏故障检测操作。It should be noted that before the panel setting module sets the on-off state of the electronic device to 0, it can obtain the first on-off state of the electronic device before the pressing operation, and send the first on-off state to the on-off screen fault in advance. Check the operation module. In other words, before the timer is started, the embodiment of the present application may pre-store the first on-off state in the on-off screen fault detection operation module, so as to facilitate subsequent on-off screen fault detection operations.

在此基础上,显示设置模块可以将亮灭屏的状态设置为非0,同时可以将设置为非0的信息发送至面板设置模块,面板设置模块可以基于显示设置模块发送的信息对电子设备的亮灭状态进行设置。同时,面板设置模块也可以将最新的亮灭状态信息发送至亮灭屏故障检测操作模块,此时的亮灭状态信息可以是第二亮灭状态。On this basis, the display setting module can set the status of the on-off screen to non-zero, and at the same time can send the information set to non-zero to the panel setting module, and the panel setting module can control the status of the electronic device based on the information sent by the display setting module. On and off state to set. At the same time, the panel setting module can also send the latest on-off state information to the on-off screen fault detection operation module, and the on-off state information at this time can be the second on-off state.

另外,亮灭屏故障检测操作模块在接收到电源键传输的亮灭屏故障检测操作请求时,其也可以启动定时器,并在定时器达到第一指定时长后,接收面板设置模块传输的亮灭状态。然后执行亮灭屏故障检测操作,即判断面板设置模块传输的第二亮灭状态与按压电源键之前电子设备的第一亮灭状态是否相同。若第一亮灭状态和第二亮灭状态相同,确定电子设备出现故障,否则确定电子设备未出现故障。In addition, when the on-off screen fault detection operation module receives the on-off screen fault detection operation request transmitted by the power button, it can also start the timer, and after the timer reaches the first specified duration, it receives the on-off screen fault transmitted by the panel setting module. off state. Then perform an on-off screen fault detection operation, that is, judge whether the second on-off state transmitted by the panel setting module is the same as the first on-off state of the electronic device before pressing the power button. If the first on-off state is the same as the second on-off state, it is determined that the electronic device is faulty; otherwise, it is determined that the electronic device is not faulty.

作为一个示例,用户在手机处于桌面模式的情况下按压电源键,此时电子设备的第一亮灭状态为非0,在6s之后,再次获取电子设备的第二亮灭状态,由于AOD模式的开启,故此时的亮灭状态也为非0。在这种情况下电子设备的屏幕属于正常运行阶段,然而如果按照上述故障检测方法进行检测,会确定出电子设备的屏幕出现故障,即存在故障误检的情况。As an example, the user presses the power button when the mobile phone is in the desktop mode. At this time, the first on-off state of the electronic device is non-zero. After 6s, the second on-off state of the electronic device is obtained again. Due to the AOD mode It is turned on, so the on-off state at this time is also non-zero. In this case, the screen of the electronic device belongs to the normal operation stage. However, if it is detected according to the above fault detection method, it will be determined that the screen of the electronic device is faulty, that is, there is a case of fault detection.

因此,为了解决上述问题,在执行亮灭屏故障检测操作之前,本申请实施例可以确定电子设备是否处于特定场景,若处于特定场景,则可以获取该特定场景对应的故障检测策略。尤其是,当特定场景为AOD场景时,本申请实施例可以通过强制设置亮灭状态,以提高故障检测的准确性。Therefore, in order to solve the above problem, before performing the on-off screen fault detection operation, the embodiment of the present application can determine whether the electronic device is in a specific scene, and if it is in a specific scene, can obtain the fault detection strategy corresponding to the specific scene. In particular, when the specific scene is an AOD scene, the embodiments of the present application may forcibly set the on-off state to improve the accuracy of fault detection.

如图8所示,本申请实施例提供的一种故障检测方法,该故障检测方法可以包括下述的步骤S110至步骤S190。As shown in FIG. 8 , a fault detection method provided by an embodiment of the present application may include the following steps S110 to S190 .

步骤S110:电源键接收按压操作。Step S110: the power key receives a press operation.

本申请实施例中,在用户按压电源键时可以触发按压操作,电源键在接收到用户输入的按压操作时,一方面可以发送灭屏请求至显示设置模块,即进入步骤S120。另一方面,电源键也可以发送亮灭屏故障检测操作请求至亮灭屏故障检测操作模块,即进入步骤S130。In the embodiment of the present application, when the user presses the power button, the pressing operation can be triggered. When the power button receives the pressing operation input by the user, on the one hand, it can send a screen-off request to the display setting module, that is, enter step S120. On the other hand, the power button may also send a fault detection operation request to the fault detection operation module of the screen on and off, that is, enter step S130.

需要说明的是,在将灭屏请求发送至显示设置模块之前,本申请实施例可以先确定电子设备当前所处的状态,若电子设备当前所处的状态为亮屏状态,则可以指示电源键向显示设置模块发送灭屏请求。其中,亮屏状态可以是电子设备处于桌面模式,也可以是处于锁屏模式。It should be noted that, before sending the off-screen request to the display setting module, the embodiment of the present application may first determine the current state of the electronic device, and if the current state of the electronic device is the on-screen state, the power button may be Send a screen off request to the display setting module. Wherein, the bright screen state may be that the electronic device is in a desktop mode, or in a lock screen mode.

作为一种方式,用户输入的按压操作可以包括按下操作,也可以包括抬起操作电子设备处于不同模式时,对应的触发亮灭屏故障检测操作的时机不同。例如,电子设备当前的模式为桌面模式时,用户对电源键执行按下操作时触发亮灭屏故障检测操作。又如,电子设备当前的模式为熄屏模式时,用户对电源键执行抬起操作时触发亮灭屏故障检测操作。As a manner, the pressing operation input by the user may include a pressing operation, and may also include a lifting operation. When the electronic device is in different modes, the corresponding timings for triggering the on-off screen fault detection operation are different. For example, when the current mode of the electronic device is the desktop mode, when the user presses the power button, a fault detection operation of turning on and off the screen is triggered. For another example, when the current mode of the electronic device is the screen-off mode, when the user lifts up the power button, a screen-on-off fault detection operation is triggered.

本申请实施例中,按压指示信息可以用于指示场景判断模块用户基于电源键输入了按下并抬起的操作。In the embodiment of the present application, the press indication information may be used to indicate that the user of the scene judgment module has input an operation of pressing and lifting based on the power key.

步骤S120:电源键向显示设置模块发送灭屏请求。Step S120: the power key sends a screen off request to the display setting module.

本申请实施例中,显示设置模块在接收到灭屏请求之前,可以预先将电子设备当前的亮灭状态发送至亮灭屏故障检测操作模块,并将该亮灭状态作为第一亮灭状态。In the embodiment of the present application, before the display setting module receives the screen-off request, it may send the current on-off state of the electronic device to the on-off screen fault detection operation module in advance, and use the on-off state as the first on-off state.

另外,亮灭屏故障检测操作模块在接收到按压操作之前也可以向面板设置模块发送亮灭状态获取请求,并在接收到显示设置模块传输的亮灭状态后,亮灭屏故障检测操作模块可以将该亮灭状态作为第一亮灭状态进行存储。In addition, the on-off screen fault detection operation module can also send the on-off state acquisition request to the panel setting module before receiving the pressing operation, and after receiving the on-off state transmitted by the display setting module, the on-off screen fault detection operation module can This on-off state is stored as the first on-off state.

步骤S130:电源键向亮灭屏故障检测操作模块发送亮灭屏故障检测操作请求。Step S130: the power key sends an on-off screen fault detection operation request to the on-off screen fault detection operation module.

通过上述介绍知道,电源键在接收到按压操作后,一方面其可以向显示设置模块发送灭屏请求,另一方面其也可以向亮灭屏故障检测操作模块发送亮灭屏故障检测操作请求,其中,灭屏请求和亮灭屏故障检测操作请求的发送顺序这里不进行明确限制,可以根据实际情况进行选择。It is known from the above introduction that after the power button receives the press operation, it can send a screen off request to the display setting module on the one hand, and it can also send a screen on/off fault detection operation request to the screen on/off fault detection operation module on the other hand. Wherein, the sending order of the screen-off request and the screen-on-off fault detection operation request is not explicitly limited here, and can be selected according to actual conditions.

步骤S140:亮灭屏故障检测操作模块启动定时器。Step S140: The on-off screen fault detection operation module starts a timer.

本申请实施例中,亮灭屏故障检测操作模块可以包括定时器,在接收到亮灭屏故障检测操作请求后,亮灭屏故障检测操作模块可以启动定时器,并在定时达到第一指定时长后,从面板设置模块处接收第二亮灭状态。In the embodiment of the present application, the on-off screen fault detection operation module may include a timer. After receiving the on-off screen fault detection operation request, the on-off screen fault detection operation module may start the timer, and reach the first specified duration at the timing Afterwards, the second on-off state is received from the panel setting module.

作为一种方式,亮灭屏故障检测操作模块在确定定时达到第一指定时长时可以向显示设置模块发送定时提示信息,显示设置模块在接收到该定时提示信息后可以将亮灭屏的状态设置为0,即进入步骤S150。As a method, the on-off screen failure detection operation module can send timing prompt information to the display setting module when it is determined that the timing reaches the first specified duration, and the display setting module can set the state of the on-off screen to the display setting module after receiving the timing prompt information. is 0, that is, enter step S150.

另外,显示设置模块在接收到灭屏请求时,也可以直接将亮灭屏的状态设置为0,在接收到亮灭屏故障检测操作模块传输的定时提示信息后,将设置后的第二亮灭状态发送至亮灭屏故障检测操作模块,以指示亮灭屏故障检测操作模块基于第一亮灭状态和第二亮灭状态执行亮灭屏故障检测操作。In addition, when the display setting module receives the request to turn off the screen, it can also directly set the state of the on-off screen to 0, and after receiving the timing prompt information transmitted by the on-off screen fault detection operation module, it will set the second on-off state. The off state is sent to the on-off screen fault detection operation module to instruct the on-off screen fault detection operation module to perform the on-off screen fault detection operation based on the first on-off state and the second on-off state.

需要说明的是,显示设置模块在将亮灭屏的状态设置为0之前,也可以向场景判断模块发送状态获取请求,该状态获取请求用于指示场景判断模块确定电子设备的AOD模式是否处于打开状态。若显示设置模块通过场景判断模块发送的状态信息确定出AOD模式处于打开状态,则可以将亮灭屏的状态设置为0。It should be noted that, before the display setting module sets the state of the on-off screen to 0, it may also send a state acquisition request to the scene judgment module, and the state acquisition request is used to instruct the scene judgment module to determine whether the AOD mode of the electronic device is on state. If the display setting module determines that the AOD mode is on through the status information sent by the scene judging module, then the status of the on/off screen can be set to 0.

步骤S150:显示设置模块将亮灭屏的状态设置为0。Step S150: The display setting module sets the status of the on-off screen to 0.

作为一种方式,电子设备在接收到按压操作之前其亮灭状态可以是亮屏状态,此时电子设备所处模式可以是桌面模式或者是锁屏模式。在定时器启动第一指定时长后,显示设置模块可以将亮灭屏的状态设置为0。换句话说,显示设置模块在确定定时器的启动第一指定时长后,其可以将电子设备的亮灭状态从1切换至0,而后显示设置模块可以将系最新的亮灭屏发送至亮灭屏故障检测操作模块。As one manner, before receiving the pressing operation, the on-off state of the electronic device may be a screen-on state, and the mode of the electronic device at this time may be a desktop mode or a lock screen mode. After the timer is started for the first specified time period, the display setting module can set the state of the on-off screen to 0. In other words, the display setting module can switch the on-off state of the electronic device from 1 to 0 after determining the first specified time period of starting the timer, and then the display setting module can send the latest on-off screen of the system to the on-off state Screen fault detection operation module.

作为另一种方式,显示设置模块在接收到灭屏请求时,其便可以将电子设备的亮灭状态从1切换成0,并在接收到亮灭屏故障检测操作模块传输的定时启动提示信息后,将设置成0的亮灭状态发送至亮灭屏故障检测操作模块。As another way, when the display setting module receives the off-screen request, it can switch the on-off state of the electronic device from 1 to 0, and start the prompt information when receiving the timing transmission of the on-off screen fault detection operation module Finally, send the on-off state set to 0 to the on-off screen fault detection operation module.

本申请实施例中,显示设置模块在将亮灭屏的状态设置为0后,显示设置模可以仅将最新的亮灭状态信息至亮灭屏故障检测操作模块,而不需要向面板设置模块发送该亮灭状态信息,如此可以避免AOD界面的显示影响亮灭检测。In the embodiment of the present application, after the display setting module sets the state of the on-off screen to 0, the display setting module can only send the latest on-off state information to the on-off screen fault detection operation module without sending it to the panel setting module. The on-off status information can prevent the display of the AOD interface from affecting the on-off detection.

步骤S160:亮灭屏故障检测操作模块接收显示设置模块传输的亮灭状态,并对应执行亮灭屏故障检测操作。Step S160: The on-off screen fault detection operation module receives the on-off status transmitted by the display setting module, and performs a corresponding on-off screen fault detection operation.

本申请实施例中,亮灭屏故障检测操作模块在接收到显示设置模块传输的将亮灭屏的状态设置为0的消息后,其可以基于第一亮灭状态和第二亮灭状态执行亮灭屏故障检测操作。其中,亮灭屏故障检测操作的检测流程可以如图9所示。In the embodiment of the present application, after receiving the message of setting the state of the on-off screen to 0 transmitted by the display setting module, the on-off screen fault detection operation module can execute the on-off state and the second on-off state based on the first on-off state and the second on-off state. Screen off fault detection operation. Wherein, the detection process of the on-off screen fault detection operation may be as shown in FIG. 9 .

步骤S161:亮灭屏故障检测操作模块获取电子设备的第一亮灭状态。Step S161: The on-off screen fault detection operation module acquires the first on-off state of the electronic device.

本申请实施例中,电子设备的第一亮灭状态可以是电源键被按压之前屏幕的亮灭状态,电源键被按压之前电子设备的模式不同,则对应的亮灭状态也不同。In the embodiment of the present application, the first on-off state of the electronic device may be the on-off state of the screen before the power key is pressed, and the corresponding on-off state is different depending on the mode of the electronic device before the power key is pressed.

作为一个示例,电源键被按压之前,若电子设备的模式为桌面模式,则电子设备的第一亮灭状态为亮屏状态,即第一亮灭状态的值可以为非0。As an example, before the power key is pressed, if the electronic device is in the desktop mode, the first on-off state of the electronic device is the on-screen state, that is, the value of the first on-off state may be non-zero.

作为一个示例,电源键被按压之前,若电子设备的模式为锁屏模式,则电子设备的第一亮灭状态为亮屏状态。As an example, before the power key is pressed, if the mode of the electronic device is the lock screen mode, the first on-off state of the electronic device is the screen-on state.

作为另一个示例,电源键被按压之前,若电子设备的模式为灭屏模式,则电子设备的第一亮灭状态为灭屏状态。另外,电源键被按压之前,若电子设备的模式为AOD模式,则电子设备的第一亮灭状态可以为亮屏状态,即第一亮灭状态的值可以是非0。As another example, before the power key is pressed, if the mode of the electronic device is the screen-off mode, the first on-off state of the electronic device is the screen-off state. In addition, before the power key is pressed, if the electronic device is in the AOD mode, the first on-off state of the electronic device may be a screen-on state, that is, the value of the first on-off state may be non-zero.

步骤S162:亮灭屏故障检测操作模块获取电子设备的第二亮灭状态。Step S162: The on-off screen fault detection operation module acquires the second on-off state of the electronic device.

通过上述介绍知道,亮灭检测模块可以包括定时器,在接收到亮灭检测请求后,定时器便可以开始计时,并在计时达到第一指定时长时,获取第二亮灭状态,在此基础上确定第一亮灭状态和第二亮灭状态是否相同。Through the above introduction, it is known that the on-off detection module can include a timer. After receiving the on-off detection request, the timer can start timing, and when the timing reaches the first specified duration, obtain the second on-off state. On this basis Determine whether the first on-off state and the second on-off state are the same.

本申请实施例中,电子设备的第二亮灭状态可以是电源键被按压之后屏幕的亮灭状态,电源键被按压之后电子设备的模式不同,则对应的亮灭状态也不同。In the embodiment of the present application, the second on-off state of the electronic device may be the on-off state of the screen after the power button is pressed. After the power button is pressed, the mode of the electronic device is different, and the corresponding on-off state is also different.

作为一个示例,电源键被按压之后,若电子设备的模式为灭屏模式,则电子设备的第二亮灭状态为灭屏状态,即第二亮灭状态的值为0。As an example, after the power button is pressed, if the mode of the electronic device is the screen-off mode, the second on-off state of the electronic device is the screen-off state, that is, the value of the second on-off state is 0.

作为一个示例,电源键被按压之后,若电子设备的模式为锁屏模式,则电子设备的第二亮灭状态为亮屏状态,即第二亮灭状态的值为非0。As an example, after the power button is pressed, if the mode of the electronic device is the lock screen mode, the second on-off state of the electronic device is the on-screen state, that is, the value of the second on-off state is not 0.

作为另一个示例,电源键被按压之后,若电子设备的模式为桌面模式,则电子设备的第二亮灭状态为亮屏状态。另外,电源键被按压之后,若电子设备的模式为AOD,则电子设备的第二亮灭状态为亮屏状态。As another example, after the power key is pressed, if the mode of the electronic device is the desktop mode, the second on-off state of the electronic device is a screen-on state. In addition, after the power button is pressed, if the mode of the electronic device is AOD, the second on-off state of the electronic device is the on-screen state.

需要说明的是,本申请实施例中的第二亮灭状态是显示设置模块根据电子设备当前的模式强制设置的状态,如此设置的主要目的是为了避免AOD界面的显示带来的故障的误检测。It should be noted that the second on-off state in the embodiment of the present application is a state forcibly set by the display setting module according to the current mode of the electronic device. The main purpose of such setting is to avoid false detection of faults caused by the display of the AOD interface .

步骤S163:亮灭屏故障检测操作模块确定第一亮灭状态和第一亮灭状态是否相同。Step S163: The on-off screen fault detection operation module determines whether the first on-off state is the same as the first on-off state.

在一些实施方式中,亮灭屏故障检测操作模块可以在接收到亮灭屏故障检测操作请求后,启动定时器,并在定时器的计时达到第一指定时长后获取第二亮灭状态。在此基础上,确定第一亮灭状态和第二亮灭状态是否相同。其中,第一指定时长可以是6秒,也可以是10秒。In some implementations, the on-off screen failure detection operation module may start a timer after receiving the on-off screen failure detection operation request, and obtain the second on-off state after the timer counts to a first specified duration. On this basis, it is determined whether the first on-off state and the second on-off state are the same. Wherein, the first specified duration may be 6 seconds or 10 seconds.

作为一个示例,电子设备处于桌面模式时,检测到用户针对电源键输入了按压操作,此时电子设备的亮灭屏故障检测操作模块启动定时器,并在定时达到6s时,获取在按压电源键之前电子设备的第一亮灭状态1,以及获取从显示设置模块处传输的第二亮灭状态0。通过判断确定出第一亮灭状态1和第二亮灭状态0不相同,因此亮灭屏故障检测操作模块确定电子设备的屏幕未发生故障。As an example, when the electronic device is in the desktop mode, it is detected that the user has input a pressing operation on the power button. At this time, the on-off screen fault detection operation module of the electronic device starts the timer, and when the timer reaches 6s, it obtains The first on-off state of the electronic device is 1, and the second on-off state 0 transmitted from the display setting module is obtained. It is determined by judging that the first on-off state 1 and the second on-off state 0 are different, so the on-off screen fault detection operation module determines that the screen of the electronic device is not faulty.

作为一种方式,若第一亮灭状态为亮屏状态,第二亮灭状态为亮屏状态,确定第一亮灭状态和第二亮灭状态相同。另外,如果第一亮灭状态为灭屏状态,第二亮灭状态为灭屏状态,确定第一亮灭状态和第二亮灭状态相同。此时可以确定出电子设备的屏幕发生故障。As a manner, if the first on-off state is a screen-on state, and the second on-off state is a screen-on state, it is determined that the first on-off state is the same as the second on-off state. In addition, if the first on-off state is the screen-off state, and the second on-off state is the screen-off state, it is determined that the first on-off state and the second on-off state are the same. At this time, it can be determined that the screen of the electronic device is faulty.

作为一种方式,若第一亮灭状态为亮屏状态,第二亮灭状态为灭屏状态,确定第一亮灭状态和第二亮灭状态不相同。另外,如果第一亮灭状态为灭屏状态,第二亮灭状态为亮屏状态,确定第一亮灭状态和第二亮灭状态不相同。此时可以确定出电子设备的屏幕未发生故障。As a manner, if the first on-off state is the on-screen state, and the second on-off state is the off-screen state, it is determined that the first on-off state is different from the second on-off state. In addition, if the first on-off state is the off-screen state, and the second on-off state is the on-screen state, it is determined that the first on-off state is different from the second on-off state. At this point, it can be determined that the screen of the electronic device is not malfunctioning.

本申请实施例中,亮灭屏故障检测操作模块在确定第一亮灭状态和第二亮灭状态相同时,确定电子设备的屏幕发生亮灭屏故障,即进入步骤S164。另外,如果第一亮灭状态和第二亮灭状态不相同,则确定电子设备的屏幕未发生亮灭屏故障,即进入步骤S166。In the embodiment of the present application, when the first on-off state and the second on-off state are determined to be the same by the on-off screen fault detection operation module, it determines that the screen on-off fault occurs on the screen of the electronic device, and then enters step S164. In addition, if the first on-off state is not the same as the second on-off state, it is determined that the screen of the electronic device does not have a screen on-off failure, that is, enter step S166.

步骤S164:亮灭屏故障检测操作模块确定电子设备的屏幕发生故障。Step S164: The on-off screen fault detection operation module determines that the screen of the electronic device is faulty.

本申请实施例中,亮灭屏故障检测操作模块通过比较第一亮灭状态和第二亮灭状态可以确定电子设备的屏幕发生故障,此时亮灭屏故障检测操作模块可以采集与故障相关的目标日志,即进入步骤S165。In the embodiment of the present application, the on-off screen fault detection operation module can determine that the screen of the electronic device is faulty by comparing the first on-off state and the second on-off state, and at this time, the on-off screen fault detection operation module can collect information related to the fault Goal log, enter step S165.

作为一个示例,电子设备在确定电子设备的屏幕发生故障时,其可以调用扬声器输出故障提示信息。另外,在确定电子设备的屏幕发生故障时,如果用户未佩戴耳机且电子设备未开启免提,则电子设备可以通过受话器输出故障提示信息。As an example, when the electronic device determines that the screen of the electronic device is faulty, it may invoke a speaker to output fault prompt information. In addition, when it is determined that a fault occurs on the screen of the electronic device, if the user does not wear an earphone and the electronic device does not turn on hands-free, the electronic device may output fault prompt information through the receiver.

作为另一个示例,在确定电子设备的屏幕发生故障时,如果用户佩戴耳机,则电子设备可以通过耳机输出故障提示信息。在此过程中,电子设备也可以先确定电子设备是否处于口袋中,若电子设备处于口袋中,且电子设备连接有耳机,则故障提示信息可以通过耳机输出至用户。As another example, when it is determined that the screen of the electronic device is faulty, if the user wears an earphone, the electronic device may output fault prompt information through the earphone. During this process, the electronic device may first determine whether the electronic device is in the pocket. If the electronic device is in the pocket and the electronic device is connected to an earphone, the fault prompt information may be output to the user through the earphone.

另外,如果电子设备未处于口袋中,且电子设备连接有耳机,可以在第一时间段内通过耳机输出故障提示信息,若第一时间段内未接收到用户输入的故障解决操作,则可以通过耳机和受话器输出故障提示信息,以加快故障解决的速率。In addition, if the electronic device is not in the pocket, and the electronic device is connected to an earphone, the fault prompt information can be output through the earphone within the first time period, and if no troubleshooting operation input by the user is received within the first time period, the The earphone and receiver output fault prompt information to speed up the speed of fault resolution.

步骤S165:亮灭屏故障检测操作模块采集与该故障相关的目标日志,并对目标日志进行存储。Step S165: The on-off screen fault detection operation module collects the target log related to the fault, and stores the target log.

作为一种方式,在确定电子设备的屏幕发生亮灭屏故障时,亮灭屏故障检测操作模块可以获取出现故障的事件,以及采集出现故障的目标日志,然后对该目标日志进行存储。其中,目标日志也可以称作是亮灭屏故障日志。As a way, when it is determined that the screen of the electronic device has an on-off screen fault, the on-off screen fault detection operation module can acquire the event of the fault, collect the target log of the fault, and then store the target log. Wherein, the target log may also be referred to as a screen on/off fault log.

本申请实施例中,目标日志可以包括D状态、Z状态等进程列表,其中,D状态为不可中断的深度睡眠状态,Z状态为僵尸状态。In this embodiment of the present application, the target log may include process lists such as D state and Z state, wherein, D state is an uninterruptible deep sleep state, and Z state is a zombie state.

另外,目标日志也可以包括系统服务(System Sever,SS)的进程状态(taskstatus),其中系统服务的进程状态可以包括阻塞信号(block signal)、运行状态(runningstatus)以及调度参数(affinity)等。因此,本申请实施例中的目标日志可以包括D状态的进程和关键进程的栈等。In addition, the target log may also include the process status (taskstatus) of the system service (System Sever, SS), wherein the process status of the system service may include a blocking signal (block signal), a running status (running status), and a scheduling parameter (affinity). Therefore, the target log in this embodiment of the present application may include processes in the D state, stacks of key processes, and the like.

作为另一种方式,在获取到出现故障的事件和出现故障的目标日志后,电子设备也可以将出现故障的时间和出现故障的目标日志发送至服务器,以使的服务器可以根据该时间和该目标日志分析电子设备的故障率。As another way, after obtaining the faulty event and the faulty target log, the electronic device can also send the faulty time and the faulty target log to the server, so that the server can Target log analysis failure rate of electronic equipment.

可选的,服务器根据故障的时间和目标日志分析出电子设备的故障率之后,一方面,服务器可以将该故障率展示给厂商,以使得厂商根据该故障率指标衡量电子设备的质量标准,并且可以发现更多的故障和可能的操作。Optionally, after the server analyzes the failure rate of the electronic equipment according to the failure time and the target log, on the one hand, the server can display the failure rate to the manufacturer, so that the manufacturer can measure the quality standard of the electronic equipment according to the failure rate index, and More faults and possible actions can be discovered.

另一方面,服务器还可以将该故障率展示给开发人员,以使得开发人员可以定位电子设备出现故障的问题。例如,定位出不亮屏/不灭屏的问题,并且解决该问题。如此,可以提高电子设备的产品质量。On the other hand, the server can also display the failure rate to the developer, so that the developer can locate the failure problem of the electronic device. For example, locate the problem of not turning on/off the screen, and solve the problem. In this way, the product quality of the electronic device can be improved.

作为另一种方式,在确定电子设备的屏幕发生故障时,电子设备也可以检测导致该故障的是否为应用进程,如果导致出现故障的进程为应用进程,则电子设备可以执行强制关闭操作。其中,强制关闭操作是用户对电子设备执行的强制关闭电子设备上当前运行的应用程序的操作。As another way, when it is determined that a fault occurs on the screen of the electronic device, the electronic device may also detect whether the fault is caused by an application process, and if the process causing the fault is an application process, the electronic device may perform a forced shutdown operation. Wherein, the forced closing operation is an operation performed by the user on the electronic device to forcibly close the application program currently running on the electronic device.

另外,在确定电子设备的屏幕发生故障时,电子设备也可以检测导致该故障的是否为应用进程系统服务进程,若导致出现该故障的进程为系统服务进程,则电子设备可以执行强制重启操作。其中,强制重启操作是用户对电子设备执行的强制重启电子设备的操作系统的操作。In addition, when it is determined that the screen of the electronic device fails, the electronic device can also detect whether the fault is caused by an application process system service process, and if the process that causes the fault is a system service process, the electronic device can perform a forced restart operation. Wherein, the forced restart operation is an operation performed by the user on the electronic device to forcibly restart the operating system of the electronic device.

作为另一种方式,在确定电子设备的屏幕发生故障时,电子设备也可以输出语音提示。例如,电子设备在确定目标应用程序导致该故障,此时电子设备则可以输出提示信息,通过该提示信息告知用户,该故障是由目标应用程序故障导致的,请强制关闭该目标应用程序。As another manner, when it is determined that the screen of the electronic device fails, the electronic device may also output a voice prompt. For example, when the electronic device determines that the fault is caused by the target application, the electronic device may output prompt information to inform the user that the fault is caused by the fault of the target application, and please close the target application forcibly.

又如,电子设备在确定系统进程导致该故障,此时电子设备则可以输出提示信息,通过该提示信息告知用户,该故障是由系统故障导致的,请长按电源键,以强制重启电子设备。For another example, when the electronic device determines that the system process has caused the fault, the electronic device can output a prompt message to inform the user that the fault is caused by a system fault. Please press and hold the power button to forcibly restart the electronic device .

步骤S166:亮灭屏故障检测操作模块确定电子设备的屏幕未发生故障。Step S166: The on-off screen fault detection operation module determines that the screen of the electronic device is not faulty.

步骤S170:显示设置模块确定显示AOD。Step S170: The display setting module determines to display the AOD.

本申请实施例中,电子设备的AOD模式处于打开状态且亮灭状态为亮屏状态时,如果接收到灭屏请求显示设置模块可以确定显示AOD。具体的,显示设置模块可以确定AOD界面是否显示完整,如果AOD显示完整,则将亮灭屏的状态设置为非0,并将设置后的消息发送至面板设置模块,及进入步骤S180。In the embodiment of the present application, when the AOD mode of the electronic device is in the open state and the on-off state is the on-screen state, the display setting module may determine to display the AOD if a screen-off request is received. Specifically, the display setting module can determine whether the display of the AOD interface is complete, and if the display of the AOD is complete, then set the state of the screen on and off to non-zero, and send the set message to the panel setting module, and enter step S180.

步骤S180:显示设置模块将亮灭屏的状态设置为非0,并将设置的消息发送至面板设置模块。Step S180: The display setting module sets the state of on-off screen to non-zero, and sends the set message to the panel setting module.

作为一种方式,面板设置模块在接收到显示设置模块传输的将亮灭屏的状态设置为非0的消息后,其可以基于该消息对应执行界面的显示操作。As a way, after the panel setting module receives a message transmitted by the display setting module to set the on-off screen state to non-zero, it can correspondingly execute the display operation of the interface based on the message.

本申请另一实施例,为了保证故障检测的准确性,在执行按压操作之前电子设备的亮灭屏的状态不同,则对应触发亮灭屏故障检测操作的时机也不相同,如此在一定程度上可以提高故障检测的准确性。具体的,电子设备在处于亮屏状态时,若接收到按压操作,则以抬起操作作为亮灭屏故障检测操作的触发时机,详细请参阅图10。In another embodiment of the present application, in order to ensure the accuracy of fault detection, the state of the on-off screen of the electronic device before the pressing operation is different, and the corresponding timing of triggering the on-off screen fault detection operation is also different, so to a certain extent The accuracy of fault detection can be improved. Specifically, when the electronic device is in the screen-on state, if a press operation is received, the lifting operation is used as a triggering opportunity for the screen-on-off fault detection operation, please refer to FIG. 10 for details.

步骤S201:电源键发送按下指示信息至场景判断模块。Step S201: the power button sends press instruction information to the scene judging module.

其中,按下指示信息用于指示场景判断模块用户针对电源键输入了按下操作。Wherein, the press indication information is used to indicate that the user of the scene judging module has input a press operation on the power key.

步骤S202:场景判断模块确定电子设备是否处于亮屏状态。Step S202: the scene judging module determines whether the electronic device is in a bright screen state.

作为一种方式,场景判断模块在确定电子设备确定电子设备是否处于亮屏状态时,其可以获取电子设备当前屏幕的亮度参数,并基于该亮度参数判断电子设备当前是否处于亮屏状态。As a way, when the scene judging module determines whether the electronic device is in the bright screen state, it can acquire the brightness parameter of the current screen of the electronic device, and judge whether the electronic device is currently in the bright screen state based on the brightness parameter.

作为一个示例,若电子设备当前屏幕的亮度参数非0,则确定电子设备当前处于亮屏状态,若当前屏幕的亮度参数为0,则确定电子设备当前处于灭屏状态。As an example, if the brightness parameter of the current screen of the electronic device is not 0, it is determined that the electronic device is currently in a screen-on state, and if the brightness parameter of the current screen is 0, it is determined that the electronic device is currently in a screen-off state.

需要说明的是,在亮度参数为非0时,场景判断模块可以先确定电子设备当前所处场景是否为AOD场景,若当前场景不是AOD场景,则确定电子设备处于亮屏状态。具体的,场景判断模块在确定亮度参数为非0时,可以确定电子设备当前显示的界面是否为AOD界面,如果不是AOD界面则确定电子设备当前处于亮屏状态。It should be noted that when the brightness parameter is non-zero, the scene judging module may first determine whether the current scene of the electronic device is an AOD scene, and if the current scene is not an AOD scene, then determine that the electronic device is in a bright screen state. Specifically, when the scene judging module determines that the brightness parameter is non-zero, it can determine whether the interface currently displayed by the electronic device is an AOD interface, and if it is not an AOD interface, determine that the electronic device is currently in a bright screen state.

作为另一种方式,电子设备处于亮屏状态时,对应电子设备的模式可以为桌面模式,也可以为锁屏模式。因此,场景判断模块在确定电子设备当前是否处于亮屏状态时,其也可以确定电子设备当前的模式是否为桌面模式,如果不是桌面模式,则可以确定是否为锁屏模式。若电子设备当前的模式既不是桌面模式也不是锁屏模式,则确定电子设备当前处于灭屏状态。As another manner, when the electronic device is in a bright screen state, the mode corresponding to the electronic device may be a desktop mode or a lock screen mode. Therefore, when the scene judging module determines whether the electronic device is currently in the bright screen state, it can also determine whether the current mode of the electronic device is the desktop mode, and if it is not the desktop mode, it can determine whether it is the lock screen mode. If the current mode of the electronic device is neither the desktop mode nor the lock screen mode, it is determined that the electronic device is currently in a screen-off state.

步骤S203:场景判断模块进入等待状态。Step S203: The scene judging module enters a waiting state.

本申请实施例中,场景判断模块在确定电子设备处于亮屏状态时,其可以进入等待状态,在该等待状态下,场景判断模块可以检测是否接收到电源键传输的抬起指示信息。In the embodiment of the present application, when the scene judging module determines that the electronic device is in the bright screen state, it may enter a waiting state, and in this waiting state, the scene judging module may detect whether it has received the lifting instruction information transmitted by the power button.

步骤S204:电源键在检测到用户输入抬起操作时,其可以向场景判断模块发送抬起指示信息。Step S204: When the power button detects that the user inputs a lifting operation, it may send lifting instruction information to the scene judging module.

本申请实施例中,抬起指示信息用于指示场景判断模块用户针对电源键输入了抬起操作。其中,按下操作和抬起操作不包括长按操作,主要原因是长按电源键电子设备的亮灭状态可能不发生改变,且这一情况为正常情况。如果抬起操作包括长按操作,则会导致亮灭屏故障检测操作的误报,进而降低用户的使用体验。In the embodiment of the present application, the lifting instruction information is used to indicate that the user of the scene judging module has input a lifting operation on the power key. Among them, the press operation and lift operation do not include the long press operation, the main reason is that the on-off state of the electronic device may not change after a long press of the power button, and this situation is normal. If the lifting operation includes a long press operation, it will cause a false alarm of the on-off screen failure detection operation, thereby reducing the user experience.

作为一个示例,按下操作与抬起操作之间的时长小于第一长按时长,其中,第一长按时长可以小于唤醒智能语音场景的第二长按时长。例如,第一长按时长为1s,第二长按时长为3s。As an example, the duration between the pressing operation and the lifting operation is shorter than the first long pressing duration, where the first long pressing duration may be shorter than the second long pressing duration for waking up the smart voice scene. For example, the duration of the first long press is 1s, and the duration of the second long press is 3s.

换句话说,场景判断模块在接收到按下指示信息的1s内如果接收到抬起指示信息,则执行后续的场景判断操作,而如果在接收到按下指示信息的1s内没有接收到抬起指示信息,则本申请实施例可以不执行后续的场景判断操作。In other words, if the scene judging module receives the lifting instruction information within 1s of receiving the pressing instruction information, it will perform subsequent scene judgment operations, and if it does not receive the lifting instruction information within 1s of receiving the pressing instruction information Instruction information, the embodiment of the present application may not perform subsequent scene judgment operations.

本申请实施例中,第一长按时长可以小于关闭电子设备的第三长按时长。例如,第一长按时长为1s,第三长按时长为10s。其中,第一长按时长、第二长按时长以及第三长按时长仅为举例,具体以实际情况为准。In the embodiment of the present application, the first long press duration may be shorter than the third long press duration for turning off the electronic device. For example, the duration of the first long press is 1s, and the duration of the third long press is 10s. Wherein, the first long-press duration, the second long-press duration, and the third long-press duration are only examples, and the actual situation shall prevail.

作为一种方式,场景判断模块在接收到电源键发送的抬起指示信息时,一方面其可以向显示设置模块发送灭屏请求,即进入步骤S205。另一方面场景判断模块也可以向亮灭屏故障检测操作模块发送亮灭屏故障检测操作请求,即进入步骤S206。As a way, when the scene judging module receives the lifting instruction information sent by the power button, on the one hand, it can send a screen-off request to the display setting module, that is, enter step S205. On the other hand, the scene judging module may also send an on-off screen fault detection operation request to the on-off screen fault detection operation module, that is, enter step S206.

步骤S205:场景判断模块向显示设置模块发送灭屏请求。Step S205: the scene judging module sends a screen off request to the display setting module.

步骤S206:场景判断模块向亮灭屏故障检测操作模块发送亮灭屏故障检测操作请求。Step S206: The scene judging module sends an on-off screen fault detection operation request to the on-off screen fault detection operation module.

作为一种方式,场景判断模块在接收到电源键传输的抬起指示信息时,其可以向亮灭屏故障检测操作模块发送亮灭屏故障检测操作请求。As a way, when the scene judging module receives the lifting indication information transmitted by the power button, it can send a screen-on-off fault detection operation request to the screen-on-off fault detection operation module.

步骤S207:亮灭屏故障检测操作模块在接收到场景判断模块传输的亮灭屏故障检测操作请求时,其可以启动定时器。Step S207: When the on-off screen fault detection operation module receives the on-off screen fault detection operation request transmitted by the scene judgment module, it may start a timer.

本申请实施例中,电子设备处于亮屏状态的情况下,如果接收到用户针对电源键输入的按压操作,则以抬起操作作为启动定时器的触发点。其中,亮屏状态对应的模式可以是桌面模式,或者也可以是锁屏模式,由于在这两个模式下只有抬起电源键时,电子设备才会从亮屏状态切换至灭屏状态,故在电子设备处于亮屏状态时以抬起操作作为定时器的启动点,如此在一定程度上可以提高故障检测的准确性。In the embodiment of the present application, when the electronic device is in the bright screen state, if a user press operation on the power key is received, the lifting operation is used as a trigger point to start the timer. Wherein, the mode corresponding to the bright screen state may be the desktop mode, or may also be the lock screen mode, because in these two modes, only when the power button is lifted, the electronic device will switch from the bright screen state to the off screen state, so When the electronic device is in the bright screen state, the lifting operation is used as the starting point of the timer, so that the accuracy of fault detection can be improved to a certain extent.

步骤S208:亮灭屏故障检测操作模块在启动定时器后,可以向显示设置模块发送定时器启动提示的消息。Step S208: After the on/off screen fault detection operation module starts the timer, it can send a timer start prompt message to the display setting module.

作为一种方式,亮灭屏故障检测操作模块在确定定时器启动后,其可以向显示设置模块发送定时器启动的提示消息,以通过该提示信息从显示设置模块获取第二亮灭状态。其中,第二亮灭状态可以是显示设置模块在接收到启动定时消息后获取的,即显示设置模块在获取到定时器启动提示消息后边可以将亮灭屏的状态设置为0,并将设置为0的消息发送至亮灭屏故障检测操作模块,该消息即可作为第二亮灭状态信息。As a way, after the on-off screen fault detection operation module determines that the timer is started, it can send a prompt message of timer start to the display setting module, so as to obtain the second on-off state from the display setting module through the prompt message. Wherein, the second on-off state can be obtained by the display setting module after receiving the start timing message, that is, the display setting module can set the state of the on-off screen to 0 after obtaining the timer start prompt message, and set it to The message of 0 is sent to the on-off screen fault detection operation module, and the message can be used as the second on-off state information.

作为另一种方式,显示设置模块在接收到场景判断模块传输的灭屏请求时,便可以将亮灭屏的状态设置为0,并在接收到亮灭屏故障检测操作模块传输的定时器启动提示消息后,将设置为0的消息传输至亮灭屏故障检测操作模块。As another way, when the display setting module receives the off-screen request transmitted by the scene judging module, it can set the state of the on-off screen to 0, and starts the timer after receiving the on-off screen fault detection operation module. After the message is prompted, the message set to 0 is transmitted to the on-off screen fault detection operation module.

需要说明的是,显示设置模块在将亮灭屏的状态设置为0之前,也可以向场景判断模块发送状态获取请求,该状态获取请求用于指示场景判断模块确定电子设备的AOD模式是否处于打开状态。若显示设置模块通过场景判断模块发送的状态信息确定出AOD模式处于打开状态,则可以将亮灭屏的状态设置为0。It should be noted that, before the display setting module sets the state of the on-off screen to 0, it may also send a state acquisition request to the scene judgment module, and the state acquisition request is used to instruct the scene judgment module to determine whether the AOD mode of the electronic device is on state. If the display setting module determines that the AOD mode is on through the status information sent by the scene judging module, then the status of the on/off screen can be set to 0.

步骤S209:亮灭屏故障检测操作模块接收显示设置模块传输的将亮灭屏的状态设置为0的消息。Step S209: The on-off screen fault detection operation module receives the message of setting the on-off screen state to 0 transmitted by the display setting module.

步骤S210:亮灭屏故障检测操作模块执行亮灭屏故障检测操作。Step S210: the on-off screen fault detection operation module performs an on-off screen fault detection operation.

步骤S211:显示设置模块确定显示AOD。Step S211: The display setting module determines to display the AOD.

步骤S212:显示设置模块将亮灭屏的状态设置为非0,并将该消息发送至亮灭检测模块。Step S212: The display setting module sets the state of the on-off screen to non-zero, and sends the message to the on-off detection module.

通过上述介绍知道,亮灭屏故障检测操作模块可以包括定时器,在接收到亮灭屏故障检测操作请求后,其可以启动定时,并确定指定时长后获取的第二亮灭状态与指定时长之前获取的第一亮灭状态是否相同。若相同确定电子设备的屏幕发生故障,若不相同,则确定电子设备的屏幕未发生故障。具体如何执行亮灭屏故障检测操作请求上述实施例已进行了详细说明,即步骤S209至步骤S212上述实施例均已进行了详细介绍这里就不再进行赘述。Through the above introduction, it is known that the on-off screen fault detection operation module can include a timer. After receiving the on-off screen fault detection operation request, it can start timing, and determine the second on-off state acquired after the specified time length and the specified time before the specified time. Whether the obtained first on-off state is the same. If they are the same, it is determined that the screen of the electronic device is faulty; if not, it is determined that the screen of the electronic device is not faulty. Specifically how to execute the on-off screen fault detection operation request has been described in detail in the above embodiments, that is, step S209 to step S212 have been described in detail in the above embodiments and will not be repeated here.

为了更清楚的理解本申请实施例,现给出如图11所示的示例图,通过图11可以看出,电子设备在处于亮屏态(桌面模式/锁屏模式)的情况下,在检测到抬起电源键时,进入等待态。在等待态下启动定时器,并确定定时器启动后的第一指定时长时电子设备的亮灭状态是否发生改变,若发生改变,则确定电子设备的亮灭屏正常,即进入灭屏态,此时屏幕的亮度为0。In order to understand the embodiment of the present application more clearly, an example diagram as shown in FIG. 11 is now given. It can be seen from FIG. When the power button is lifted, it enters a waiting state. Start the timer in the waiting state, and determine whether the on-off state of the electronic device changes during the first specified time after the timer is started. If it changes, determine that the on-off screen of the electronic device is normal, that is, enter the off-screen state, At this time, the brightness of the screen is 0.

另外,如果定时器超时,电子设备的亮灭状态仍未发生改变,则确定电子设备的屏幕发生故障。换句话说,在确定定时器启动第一指定时长后,若电子设备的亮灭状态仍未发生改变,则确定定时器超时,此时便进入超时态,即确定电子设备的屏幕发生故障。例如,在执行抬起操作之前电子设备的亮度为非0,而在执行抬起操作之后的6s后电子设备的亮度仍为非0,则确定电子设备的屏幕发生故障。In addition, if the timer expires and the on-off state of the electronic device has not changed, it is determined that the screen of the electronic device is faulty. In other words, if the on-off state of the electronic device has not changed after the timer is determined to be started for the first specified time, the timer is determined to be timed out, and then enters the timeout state, that is, it is determined that the screen of the electronic device is faulty. For example, if the brightness of the electronic device is non-zero before the lifting operation is performed, and the brightness of the electronic device is still non-zero 6 seconds after the lifting operation is performed, it is determined that the screen of the electronic device is faulty.

需要说明的是,本申请实施例中的特定场景还可以包括接近光场景、组合按压场景以及语音唤醒场景,场景判断模块在确定电子设备当前所处场景为接近光场景、组合按压场景或者语音唤醒场景时,对应的故障检测策略是不发送故障检测请求至亮灭屏故障检测操作模块。如此不仅可以降低亮灭屏故障检测操作为电子设备带来的不必功耗,同时可以提高故障检测的准确性。It should be noted that the specific scene in the embodiment of the present application may also include a proximity light scene, a combined pressing scene, and a voice wake-up scene. In the scenario, the corresponding fault detection strategy is not to send a fault detection request to the on-off screen fault detection operation module. This can not only reduce the unnecessary power consumption of the electronic equipment caused by the on-off screen fault detection operation, but also improve the accuracy of fault detection.

另外,如果电子设备当前所处场景不是接近光场景、组合按压场景或者语音唤醒场景,则可以确定电子设备的AOD模式是否处于打开状态,若处于打开状态,则通过强制设置电子设备屏幕的亮灭状态来降低故障的误检测率。In addition, if the current scene of the electronic device is not a proximity light scene, a combined pressing scene or a voice wake-up scene, it can be determined whether the AOD mode of the electronic device is on, and if it is on, the electronic device screen can be forcibly set to turn on or off. state to reduce the false detection rate of faults.

在一些实施方式中,接近光场景可以是电子设备在通话过程中基于接近光传感器检测到电子设备的屏幕处于遮挡状态的一种场景。例如,用户手持电子设备贴近耳朵进行通话所产生的场景可以称作是接近光场景。进入接近光场景后电子设备处于灭屏状态,而当退出接近光场景后电子设备则处于亮屏状态,如此在一定程度上可以降低电子设备的功耗。In some implementations, the proximity light scene may be a scene in which the electronic device detects that the screen of the electronic device is in a blocking state based on the proximity light sensor during a call. For example, a scene generated by a user holding an electronic device close to an ear to make a call may be called a near-light scene. After entering the near-light scene, the electronic device is in an off-screen state, and when exiting the near-light scene, the electronic device is in a bright-screen state, which can reduce the power consumption of the electronic device to a certain extent.

另外,若在电子设备处于接近光场景时按压电源键,则电子设备的亮灭状态不发生改变,此时电子设备处于正常运行阶段,为了避免故障的误检测,在确定电子设备处于接近光场景时场景判断模块可以不向亮灭屏故障检测操作模块发送亮灭屏故障检测操作请求。In addition, if the power button is pressed when the electronic device is in the near-light scene, the on-off status of the electronic device will not change. At this time, the electronic device is in the normal operation stage. The on-off screen fault detection operation module may not send the on-off screen fault detection operation module to the on-off screen fault detection operation module.

具体的,场景判断模块可以确定电子设备当前所处场景是否为接近光场景,若为接近光场景,则场景判断模块可以不向亮灭屏故障检测操作模块发送亮灭屏故障检测操作请求。Specifically, the scene judging module may determine whether the current scene of the electronic device is a near-light scene, and if it is a near-light scene, the scene judging module may not send an on-off screen fault detection operation request to the on-off screen fault detection operation module.

另外,在判断电子设备当前所处场景是否为接近光场景时,场景判断模块可以结合传感器驱动传输的各传感器采集的数据综合确定。其中,传感器采集的数据可以是多个不同类型的传感器采集的,多个不同类型的传感器可以包括接近光传感器、温度传感器、距离传感器以及光照传感器等。In addition, when judging whether the current scene of the electronic device is a near-light scene, the scene judging module may comprehensively determine in combination with the data collected by each sensor driven and transmitted by the sensor. The data collected by the sensor may be collected by a plurality of different types of sensors, and the plurality of different types of sensors may include a proximity light sensor, a temperature sensor, a distance sensor, and an illumination sensor.

作为一个示例,确定电子设备当前所处场景是否为接近光场景时,场景判断模块首先可以确定电子设备当前是否处于通话状态,若电子设备当前处于通话状态,则场景判断模块可以从传感器驱动处获取传感器采集的数据,而后基于传感器驱动传输的该数据确定电子设备当前所处场景是否为接近光场景。As an example, when determining whether the scene where the electronic device is currently located is a near-light scene, the scene judgment module can first determine whether the electronic device is currently in a call state, and if the electronic device is currently in a call state, the scene judgment module can obtain from the sensor driver The data collected by the sensor, and then based on the data transmitted by the sensor driver, it is determined whether the scene where the electronic device is currently located is a near-light scene.

另外,电子设备可以存储有接近光标记,该接近光标记用于表示电子设备当前是否处于接近光场景,当接近光标记为第一标记值时,确定电子设备当前所处场景为接近光场景。当接近光标记为第二标记值时,确定电子设备当前所处场景为接近光场景。换句话说,电子设备在进入接近光场景时可以将接近光标记设置为第一标记值,而当电子设备退出接近光场景时,则可以将接近光标记设置为第二标记值。In addition, the electronic device may store a proximity light flag, the proximity light flag is used to indicate whether the electronic device is currently in a proximity light scene, and when the proximity light flag is the first flag value, it is determined that the current scene of the electronic device is a proximity light scene. When the proximity light flag is the second flag value, it is determined that the current scene of the electronic device is the proximity light scene. In other words, when the electronic device enters the proximity light scene, the proximity light flag can be set to the first flag value, and when the electronic device exits the proximity light scene, the proximity light flag can be set to the second flag value.

作为另一种方式,场景判断模块确定电子设备进入接近光场景时,其可以将接近光标记设置为第一标记值,并在检测到电子设备退出接近光场景时,场景判断模块可以将接近光标记设置为第二标记值。在接收到按压指示信息后,场景判断模块可以直接读取接近光标记,并基于读取的接近光标记确定电子设备当前是否处于接近光场景。As another way, when the scene judgment module determines that the electronic device enters the proximity light scene, it can set the proximity light flag as the first flag value, and when it detects that the electronic device exits the proximity light scene, the scene judgment module can set the proximity light The flag is set to the second flag value. After receiving the pressing indication information, the scene judging module can directly read the proximity light mark, and determine whether the electronic device is currently in the proximity light scene based on the read proximity light mark.

作为一个示例,第一标记值可以为1,即在确定第一标记值为1时,确定电子设备当前所处场景为接近光场景。另外,第二标记值可以为0,即在确定第二标记值为0时,确定电子设备当前所处场景不是接近光场景。As an example, the first flag value may be 1, that is, when it is determined that the first flag value is 1, it is determined that the scene where the electronic device is currently located is a near-light scene. In addition, the second flag value may be 0, that is, when it is determined that the second flag value is 0, it is determined that the scene where the electronic device is currently located is not a near-light scene.

可选的,场景判断模块在接收到电源键传输的按压指示信息时,其可以先获取接近光标记,然后确定接近光标记是否为1,若接近光标记为1,则确定电子设备当前所处场景为接近光场景。若接近光标记为0,则确定电子设备当前所处场景不是接近光场景。Optionally, when the scene judging module receives the pressing indication information transmitted by the power button, it can first obtain the proximity light flag, and then determine whether the proximity light flag is 1, and if the proximity light flag is 1, determine the current location of the electronic device. The scene is near light scene. If the proximity light flag is 0, it is determined that the scene where the electronic device is currently located is not a proximity light scene.

作为另一个示例,第一标记值可以为True,即在确定第一标记值为True时,确定电子设备当前所处场景为接近光场景。另外,第二标记值可以为False,即在确定第二标记值为False时,确定电子设备当前所处场景不是接近光场景。As another example, the first flag value may be True, that is, when it is determined that the first flag value is True, it is determined that the scene where the electronic device is currently located is a near-light scene. In addition, the second flag value may be False, that is, when it is determined that the second flag value is False, it is determined that the scene where the electronic device is currently located is not a near-light scene.

可选的,场景判断模块在接收到电源键传输的按压指示信息时,其可以先获取接近光标记,然后确定接近光标记是否为True,若接近光标记为True,则确定电子设备当前所处场景为接近光场景。若接近光标记为False,则确定电子设备当前所处场景不是接近光场景。Optionally, when the scene judging module receives the pressing indication information transmitted by the power button, it can first obtain the proximity light flag, and then determine whether the proximity light flag is True, and if the proximity light flag is True, determine the current location of the electronic device. The scene is near light scene. If the proximity light flag is False, it is determined that the scene where the electronic device is currently located is not a proximity light scene.

需要说明的是,第一标记值和第二标记值可以设置成任一两个不相同的值,只要其可以区分出进入接近光场景和退出接近光场景便可以,第一标记值和第二标记值具体设置成多少这里不进行明确限制,可以根据实际情况进行选择。It should be noted that the first flag value and the second flag value can be set to any two different values, as long as it can distinguish between entering the approaching light scene and exiting the approaching light scene, the first flag value and the second There is no clear limit to the specific setting of the tag value, and it can be selected according to the actual situation.

在另一些实施方式中,组合按压场景可以是电子设备在桌面模式下接收到用户输入的组合按压操作时产生的场景,其中,组合按压操作可以是用户在按压电源键的同时按压了其他按键的场景。In some other implementations, the combined pressing scene may be a scene generated when the electronic device receives a combined pressing operation input by the user in the desktop mode, wherein the combined pressing operation may be that the user presses the power button while pressing other buttons. Scenes.

作为一个示例,在电子设备处于桌面模式时,若场景判断模块检测到用户在按压电源键的同时按压了音量降低键,则触发截屏操作,该截屏操作用于截取电子设备当前界面中显示的内容。As an example, when the electronic device is in the desktop mode, if the scene judging module detects that the user presses the volume down key while pressing the power key, a screen capture operation is triggered, and the screen capture operation is used to capture the content displayed in the current interface of the electronic device .

作为一个示例,在电子设备处于桌面模式时,若场景判断模块检测到用户在按压电源键的同时按压了音量升高键,则触发录屏操作,该录屏操作用于录制电子设备当前界面中显示的内容。As an example, when the electronic device is in desktop mode, if the scene judgment module detects that the user presses the volume up key while pressing the power key, a screen recording operation is triggered, and the screen recording operation is used to record the current interface of the electronic device. displayed content.

本申请实施例中,同时按压电源键和音量键可以触发组合按压场景,同时按压电源键和其他键也可以触发组合按压场景,其他键具体是哪个这里不进行明确限制可以根据实际情况进行选择。In this embodiment of the application, pressing the power button and the volume button at the same time can trigger a combined pressing scene, and pressing the power button and other keys at the same time can also trigger a combined pressing scene. The other keys that are not specifically limited here can be selected according to the actual situation.

综上所述,在组合按压场景下,按压电源键前后,电子设备的亮灭状态并未发生改变,即在按压电源键之前电子设备为亮屏状态,执行组合按压操作后电子设备仍然处于亮屏状态。To sum up, in the combined pressing scene, the on-off state of the electronic device does not change before and after pressing the power button, that is, the electronic device is in the on-screen state before pressing the power button, and the electronic device is still on after the combined pressing operation. screen status.

可见,按压电源键前后电子设备的亮灭状态未发生改变,且这种情况并不是由于亮灭屏故障引起的,而是电子设备正常运行截屏/录屏等功能的体现,此时若执行亮灭屏故障检测操作,不仅会提高电子设备不必要的功耗,同时会提高故障检测的误检率,进而影响用户的使用体验。It can be seen that the on-off state of the electronic device has not changed before and after pressing the power button, and this situation is not caused by a fault in the on-off screen, but a reflection of the normal operation of the electronic device such as screen capture/recording. The screen-off fault detection operation will not only increase unnecessary power consumption of electronic equipment, but also increase the false detection rate of fault detection, thereby affecting user experience.

为了解决上述问题,本申请实施例在确定电子设备所述场景为组合按压场景时,可以不执行亮灭屏故障检测操作,如此不仅可以提高故障检测的准确性,同时可以降低电子设备的功耗。In order to solve the above problems, in the embodiment of the present application, when the scene described in the electronic device is determined to be a combined pressing scene, the on-off screen fault detection operation may not be performed, so that not only the accuracy of fault detection can be improved, but also the power consumption of the electronic device can be reduced .

在另一些实施方式中,语音唤醒场景可以是电子设备在桌面模式下接收到用户长按电源键时产生的场景。另外,语音唤醒场景也可以是电子设备在锁屏模式下接收到用户长按电源键时产生的场景。In some other implementation manners, the voice wake-up scene may be a scene generated when the electronic device receives a long press of the power button by the user in desktop mode. In addition, the voice wake-up scene may also be a scene generated when the electronic device receives a long press of the power button by the user in the lock screen mode.

场景判断模块在检测到用户针对电源键输入按压操作时,其可以获取按下操作的持续时长。然后确定该持续时长是否达到第一长按时长,若达到第一长按时长,则确定电子设备所处场景为语音唤醒场景。例如,第一长按时长可以为1s。When the scene judging module detects that the user inputs a pressing operation on the power button, it can obtain the duration of the pressing operation. Then it is determined whether the duration reaches the first long-press duration, and if it reaches the first long-press duration, it is determined that the scene where the electronic device is located is a voice wake-up scene. For example, the duration of the first long press may be 1s.

本申请实施例中,长按电源键的时长超出第一长按时长后电子设备进入语音唤醒场景,在语音唤醒场景下,用户可以通过输入语音指示电子设备执行不同的操作。例如,用户输入语音“打开相机”,则电子设备此时可以对应开启相机。In the embodiment of the present application, the electronic device enters the voice wake-up scene after the power button is pressed for longer than the first long press time. In the voice wake-up scene, the user can instruct the electronic device to perform different operations by inputting voice. For example, if the user inputs the voice "turn on the camera", the electronic device can correspondingly turn on the camera at this time.

另外,当长按电源键的时长超出第二长按时长后电子设备则进入关机场景,其中,关机场景可以包括关机控件、重启控件以及其他提示信息等。用户按压不同的控件,电子设备便可以执行对应的操作。其中,第一长按时长小于第长按二时长。例如,第一长按时长为1s,第二长按时长为3s。In addition, when the power button is pressed for longer than the second long press time, the electronic device enters a shutdown scene, wherein the shutdown scene may include a shutdown control, a restart control, and other prompt information. When the user presses different controls, the electronic device can perform corresponding operations. Wherein, the duration of the first long press is shorter than the second duration of the second long press. For example, the duration of the first long press is 1s, and the duration of the second long press is 3s.

需要说明的是,在电子设备进入关机场景后,若用户仍长按电源键第三长按时长,则电子设备直接关机。其中,第三长按时长大于第二长按时长。例如,第三长按时长为10s。It should be noted that after the electronic device enters the shutdown scene, if the user still presses the power button for a third long time, the electronic device will be directly shut down. Wherein, the third long press duration is longer than the second long press duration. For example, the duration of the third long press is 10s.

通过上述介绍可以知道,电子设备在处于桌面模式时,检测到用户长按电源键,并且长按电源键超出1s,电子设备便进入语音唤醒场景。在长按电源键之前电子设备处于为亮屏状态,长按电源键之后电子设备仍然处于亮屏状态。换句话说,通过长按电源键进入语音唤醒场景之前电子设备处于亮屏状态,且通过长按电源键进入语音唤醒场景之后电子设备仍处于亮屏状态。From the above introduction, it can be known that when the electronic device is in the desktop mode, it detects that the user presses the power button for a long time, and the electronic device enters the voice wake-up scene if the user presses the power button for more than 1 second. Before pressing and holding the power button, the electronic device is in a bright screen state, and after long pressing the power button, the electronic device is still in a bright screen state. In other words, the electronic device is in the screen-on state before entering the voice wake-up scene by long pressing the power button, and the electronic device is still in the screen-on state after entering the voice wake-up scene by long pressing the power button.

可见,长按电源键前后电子设备的亮灭状态未发生改变,且这种情况并不是由于亮灭屏故障引起的,而是电子设备正常运行语音唤醒功能的体现,此时若执行亮灭屏故障检测操作,不仅会提高电子设备不必要的功耗,同时会提高故障检测的误检率,进而影响用户的使用体验。It can be seen that the on-off state of the electronic device does not change before and after long pressing the power button, and this situation is not caused by a fault in the on-off screen, but a reflection of the voice wake-up function of the normal operation of the electronic device. The fault detection operation will not only increase unnecessary power consumption of electronic equipment, but also increase the false detection rate of fault detection, thereby affecting user experience.

为了解决上述问题,本申请实施例在确定电子设备所述场景为语音唤醒场景时,可以不执行亮灭屏故障检测操作,如此不仅可以提高故障检测的准确性,同时可以降低电子设备的功耗。In order to solve the above problems, in the embodiment of the present application, when the scene described by the electronic device is determined to be a voice wake-up scene, the on-off screen fault detection operation may not be performed, so that not only the accuracy of fault detection can be improved, but also the power consumption of the electronic device can be reduced. .

本申请又一实施例,为了保证故障检测的准确性,在执行按压操作之前电子设备的亮灭屏的状态不同,则对应触发亮灭屏故障检测操作的时机也不相同,具体的,当电子设备处于亮屏状态时,以抬起操作作为灭屏检测操作的触发点,如此在一定程度上可以提高故障检测的准确性。另外,灭屏状态对应的模式可以包括AOD模式,详细请参阅图12。In yet another embodiment of the present application, in order to ensure the accuracy of fault detection, the state of the on-off screen of the electronic device is different before the pressing operation, and the corresponding timing of triggering the on-off screen fault detection operation is also different. Specifically, when the electronic device When the device is in the screen-on state, the lifting operation is used as the trigger point for the screen-off detection operation, which can improve the accuracy of fault detection to a certain extent. In addition, the modes corresponding to the off-screen state may include the AOD mode, please refer to FIG. 12 for details.

步骤S301:电源键发送按下指示信息至场景判断模块。Step S301: the power button sends press instruction information to the scene judging module.

步骤S302:场景判断模块确定电子设备是否处于AOD显示。Step S302: the scene judging module determines whether the electronic device is in AOD display.

本申请实施例中,场景判断模块在接收到按下指示信息的情况下,其可以获取电子设备当前屏幕的亮度参数,并在确定亮度参数参与时,确定电子设备当前显示的界面是否为AOD界面,若为AOD界面则确定电子设备当前处于AOD显示。In the embodiment of the present application, when the scene judging module receives the pressing instruction information, it can obtain the brightness parameter of the current screen of the electronic device, and determine whether the interface currently displayed by the electronic device is an AOD interface when determining that the brightness parameter is involved. , if it is an AOD interface, it is determined that the electronic device is currently displaying AOD.

在一些实施方式中,如果确定电子设备当前处于AOD显示,则可以确定电子设备当前处于亮屏状态。其中,AOD是指电子设备息屏时,显示屏的部分区域保持常亮或者显示屏检测到触屏操作时部分区域亮起的一种显示模式。In some implementation manners, if it is determined that the electronic device is currently in AOD display, it may be determined that the electronic device is currently in a screen-on state. Among them, AOD refers to a display mode in which when the screen of the electronic device is off, some areas of the display screen remain always on or some areas of the display screen light up when a touch screen operation is detected.

步骤S303:场景判断模块向显示设置模块发送亮灭状态设置请求。Step S303: The scene judging module sends a request for setting the on-off state to the display setting module.

作为一种方式,场景判断模块在确定电子设备当前的显示界面为AOD界面时,为了避免故障的误检测,其可以向显示设置模块发送亮灭状态设置请求,以通过该请求指示显示设置模块将电子设备屏幕的亮灭状态设置为0,即进入步骤S304。As a method, when the scene judging module determines that the current display interface of the electronic device is an AOD interface, in order to avoid false detection of faults, it can send a bright-off state setting request to the display setting module, so as to instruct the display setting module through the request. The on-off status of the screen of the electronic device is set to 0, that is, step S304 is entered.

步骤S304:显示设置模块将屏幕的亮灭状态设置为0。Step S304: The display setting module sets the on-off state of the screen to 0.

步骤S305:显示设置模块将亮灭状态设置为0的消息发送至亮灭屏故障检测操作模块。Step S305: The display setting module sends a message that the on-off state is set to 0 to the on-off screen fault detection operation module.

在一些实施方式中,亮灭屏故障检测操作模块在接收到显示设置模块传输的亮灭状态后,其可以将该亮灭状态作为第一亮灭状态,并对第一亮灭状态进行存储。另外,亮灭屏故障检测操作模块在接收到显示设置模块传输的亮灭状态为0的消息后可以向场景判断模块发送设置成功的提示信息,场景判断模块在接收到该提示信息后,可以向亮灭屏故障检测操作模块发送亮屏请求。In some implementations, after receiving the on-off state transmitted by the display setting module, the on-off screen failure detection operation module may use the on-off state as the first on-off state and store the first on-off state. In addition, after receiving the message that the on-off state is 0 transmitted by the display setting module, the on-off screen failure detection operation module can send a prompt message that the setting is successful to the scene judgment module. The on-off screen fault detection operation module sends a screen on request.

作为一种方式,在接收到按压操作之前由于电子设备处于AOD界面,故此时亮灭屏故障检测操作模块存储的第一亮灭状态为非0,而在接收到显示设置模块传输的将亮灭状态设置为0的消息后,亮灭检测模块可以将第一亮灭状态更新为0。As a method, since the electronic device is in the AOD interface before receiving the pressing operation, the first on-off state stored by the on-off screen fault detection operation module is non-zero at this time, and the on-off state will be on and off after receiving the transmission from the display setting module. After the state is set to 0, the on-off detection module may update the first on-off state to 0.

步骤S306:场景判断模块向显示设置模块发送亮屏请求。Step S306: the scene judging module sends a screen brightening request to the display setting module.

步骤S307:显示设置模块确定显示亮屏界面。Step S307: The display setting module determines to display the bright screen interface.

步骤S308:场景判断模块向亮灭屏故障检测操作模块发送亮灭屏故障检测操作请求。Step S308: The scene judging module sends an operation request for the on-off screen fault detection operation module to the on-off screen fault detection operation module.

步骤S309:亮灭屏故障检测操作模块在接收到场景判断模块传输的亮灭屏故障检测操作请求时,其可以启动定时器。Step S309: When the on-off screen fault detection operation module receives the on-off screen fault detection operation request transmitted by the scene judgment module, it can start a timer.

步骤S310:亮灭屏故障检测操作模块在启动定时器后,可以向显示设置模块发送定时器启动提示的消息。Step S310: After the on/off screen fault detection operation module starts the timer, it can send a timer start prompt message to the display setting module.

步骤S311:面板设置模块接收显示设置模块传输的亮灭屏的状态。Step S311: The panel setting module receives the on-off screen status transmitted by the display setting module.

作为一种方式,显示设置模块在接收到定时器启动提示的消息后,其可以将亮灭的状态设置为非0,并将设置为非0的消息发送至面板设置模块,而面板设置模块在接收到设置为非0的消息后,可以基于该消息对电子设备的亮灭屏状态进行设置。另外,面板设置模块也可以将设置为非0的消息传输至亮灭屏故障检测操作模块。As a way, after the display setting module receives the message that the timer starts prompting, it can set the on-off state to non-zero, and send the message that is set to non-zero to the panel setting module, and the panel setting module After receiving the message that is set to be non-zero, the screen on/off status of the electronic device can be set based on the message. In addition, the panel setting module can also transmit the message set to non-zero to the on-off screen fault detection operation module.

步骤S312:亮灭屏故障检测操作模块接收面板设置模块传输的将亮灭状态设置为0的消息。Step S312: The on-off screen fault detection operation module receives the message of setting the on-off state to 0 transmitted by the panel setting module.

本申请实施例中,亮灭屏故障检测操作模块接收到将亮灭状态设置为0的消息后,可以确定出电子设备当前所处的状态,并将该状态作为第二亮灭状态。In the embodiment of the present application, after receiving the message of setting the on-off state to 0, the on-off screen failure detection operation module can determine the current state of the electronic device, and use this state as the second on-off state.

步骤S313:亮灭屏故障检测操作模块执行亮灭屏故障检测操作。Step S313: The on-off screen fault detection operation module performs an on-off screen fault detection operation.

作为一种方式,在启动定时器之前电子设备的第一亮灭状态被强制设置为0,而在亮屏界面显示成功后,获取的第二亮灭状态则为非0。通过判断知道第一亮灭状态和第二亮灭状态不相同。因此,电子设备在显示AOD界面时,如果接收到针对电源键的按压操作,以按下操作作为启动定时器的触发点,并且在发送亮灭屏故障检测操作请求之前可以将亮灭状态强制设置为0,如此可以保证故障检测的准确性。As a way, the first on-off state of the electronic device is forcibly set to 0 before the timer is started, and the obtained second on-off state is non-zero after the screen on-screen interface is successfully displayed. By judging, it is known that the first on-off state is different from the second on-off state. Therefore, when the electronic device displays the AOD interface, if it receives a press operation for the power button, the press operation is used as the trigger point to start the timer, and the on-off state can be forcibly set before sending the on-off screen fault detection operation request is 0, which can ensure the accuracy of fault detection.

需要说明的是,当电子设备处于息屏模式时,如果接收到按压操作,也是以按下操作作为启动定时器的触发点。It should be noted that when the electronic device is in the off-screen mode, if a press operation is received, the press operation is also used as a trigger point to start the timer.

通过上述介绍知道,亮灭屏故障检测操作模块可以包括定时器,在接收到亮灭屏故障检测操作请求后,其可以启动定时。在定时达到第一指定时长时,获取第一亮灭状态和第二亮灭状态,接着确定第一亮灭状态与第二亮灭状态是否相同,若相同确定电子设备的屏幕发生故障。若不相同,则确定电子设备的屏幕未发生故障。具体如何执行亮灭屏故障检测操作请求上述实施例已进行了详细说明,这里就不再进行赘述。It is known from the above introduction that the on-off screen fault detection operation module may include a timer, which can start timing after receiving the on-off screen fault detection operation request. When the timing reaches the first specified duration, the first on-off state and the second on-off state are obtained, and then it is determined whether the first on-off state and the second on-off state are the same, and if they are the same, it is determined that the screen of the electronic device is faulty. If not, it is determined that the screen of the electronic device is not malfunctioning. Specifically, how to perform the on-off screen fault detection operation request has been described in detail in the above-mentioned embodiments, and will not be repeated here.

为了更清楚的理解本申请实施例,现给出如图13所示的示例图,通过图13可以看出,电子设备在处于灭屏态(AOD模式/息屏模式)时,只要检测到用户按下电源键,便进入等待态,在等待态下启动定时器,并确定定时器触发的第一指定时长后电子设备的亮灭状态是否发生改变,若发生改变,则确定电子设备的亮灭屏正常,即进入亮屏态,此时屏幕的亮度为非0。In order to understand the embodiment of the present application more clearly, an example diagram as shown in FIG. 13 is now given. It can be seen from FIG. 13 that when the electronic device is in the Press the power button to enter the waiting state, start the timer in the waiting state, and determine whether the on-off state of the electronic device changes after the first specified time period triggered by the timer, and if it changes, determine the on-off state of the electronic device If the screen is normal, it enters the bright screen state, and the brightness of the screen is non-zero at this time.

另外,如果定时器超时,电子设备的亮灭状态仍未发生改变,则确定电子设备的屏幕发生故障。换句话说,在确定定时器触发第一指定时长后,若电子设备的亮灭状态仍未发生改变,则确定定时器超时,此时便进入超时态,即确定电子设备的屏幕发生故障。例如,在执行按下操作之前电子设备的亮度为0,而在执行按下操作之后的6s后电子设备的亮度仍为0,则确定电子设备的屏幕发生故障。In addition, if the timer expires and the on-off state of the electronic device has not changed, it is determined that the screen of the electronic device is faulty. In other words, if the on-off state of the electronic device has not changed after the timer is determined to be triggered for the first specified time period, the timer is determined to be timed out, and then enters the timeout state, that is, it is determined that the screen of the electronic device is faulty. For example, if the brightness of the electronic device is 0 before the pressing operation is performed, but the brightness of the electronic device is still 0 6 seconds after the pressing operation is performed, it is determined that the screen of the electronic device is faulty.

可以理解的是,电子设备为了实现上述功能,其包含了执行各个功能相应的硬件和/或软件模块。结合本文中所公开的实施例描述的各示例的算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。本领域技术人员可以结合实施例对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。It can be understood that, in order to realize the above functions, the electronic device includes hardware and/or software modules corresponding to each function. Combining the algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software drives hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions in combination with the embodiments for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.

本实施例还提供一种计算机存储介质,该计算机存储介质中存储有计算机指令,当该计算机指令在电子设备上运行时,使得电子设备执行上述相关方法步骤实现上述实施例中的故障检测方法。This embodiment also provides a computer storage medium, in which computer instructions are stored, and when the computer instructions are run on the electronic device, the electronic device is made to execute the above related method steps to implement the fault detection method in the above embodiment.

本实施例还提供了一种计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述相关步骤,以实现上述实施例中的故障检测方法。This embodiment also provides a computer program product, which, when running on a computer, causes the computer to execute the above-mentioned related steps, so as to realize the fault detection method in the above-mentioned embodiment.

另外,本申请的实施例还提供一种装置,这个装置具体可以是芯片,组件或模块,该装置可包括相连的处理器和存储器;其中,存储器用于存储计算机执行指令,当装置运行时,处理器可执行存储器存储的计算机执行指令,以使芯片执行上述各方法实施例中的故障检测方法。In addition, an embodiment of the present application also provides a device, which may specifically be a chip, a component or a module, and the device may include a connected processor and a memory; wherein the memory is used to store computer-executable instructions, and when the device is running, The processor can execute the computer-executable instructions stored in the memory, so that the chip executes the fault detection method in the above method embodiments.

其中,本实施例提供的电子设备、计算机存储介质、计算机程序产品或芯片均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。Wherein, the electronic device, computer storage medium, computer program product or chip provided in this embodiment is all used to execute the corresponding method provided above, therefore, the beneficial effects it can achieve can refer to the corresponding method provided above The beneficial effects in the method will not be repeated here.

通过以上实施方式的描述,所属领域的技术人员可以了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。Through the description of the above embodiments, those skilled in the art can understand that for the convenience and brevity of the description, only the division of the above-mentioned functional modules is used as an example for illustration. In practical applications, the above-mentioned functions can be assigned by different Completion of functional modules means that the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.

在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed devices and methods may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or It may be integrated into another device, or some features may be omitted, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.

作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。A unit described as a separate component may or may not be physically separated, and a component shown as a unit may be one physical unit or multiple physical units, which may be located in one place or distributed to multiple different places. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

本申请各个实施例的任意内容,以及同一实施例的任意内容,均可以自由组合。对上述内容的任意组合均在本申请的范围之内。Any content of each embodiment of the present application, as well as any content of the same embodiment, can be freely combined. Any combination of the above contents is within the scope of the present application.

集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(readonlymemory,ROM)、随机存取存储器(randomaccessmemory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If an integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the software product is stored in a storage medium Among them, several instructions are included to make a device (which may be a single-chip microcomputer, a chip, etc.) or a processor (processor) execute all or part of the steps of the methods in various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (read only memory, ROM), random access memory (random access memory, RAM), magnetic disk or optical disk, and other various media that can store program codes.

上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。The embodiments of the present application have been described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementations. The above-mentioned specific implementations are only illustrative and not restrictive. Those of ordinary skill in the art will Under the inspiration of this application, without departing from the purpose of this application and the scope of protection of the claims, many forms can also be made, all of which belong to the protection of this application.

Claims (25)

1. A fault detection method, applied to an electronic device, the method comprising:
responding to the pressing operation of a user on a power key of the electronic equipment, starting a timer, and enabling the electronic equipment to enter an AOD display state after receiving the pressing operation;
acquiring a first on-off state, wherein the first on-off state is the on-off state of the screen of the electronic equipment before the power key is pressed;
setting a second on-off state to be an off-screen state, wherein the second on-off state is used for representing the on-off state of the screen of the electronic equipment after the power key is pressed;
and performing a bright-out screen fault detection operation based on the first bright-out state and the second bright-out state when the timing of the timer reaches a specified duration.
2. The method of claim 1, wherein the pressing operation comprises a pressing operation and a lifting operation, and wherein the starting a timer in response to a pressing operation of a power key of the electronic device by a user comprises:
determining whether the electronic equipment is in a bright screen state or not in response to the pressing operation of a power key of the electronic equipment by a user;
and if the electronic equipment is in a bright screen state, starting the timer when the lifting operation is received.
3. The method of claim 1, wherein the starting a timer in response to a user pressing a power key of the electronic device comprises:
responding to the pressing operation of a user on a power key of the electronic equipment, determining whether a scene where the electronic equipment is located is a specific scene, and when the pressing operation is received under the specific scene, the on-off state of a screen of the electronic equipment is not changed;
and if the scene where the electronic equipment is located is not the specific scene, starting the timer.
4. A method according to claim 3, characterized in that the method further comprises:
and if the scene where the electronic equipment is located is the specific scene, not executing the operation of detecting the on-off screen fault.
5. The method of claim 3 or 4, wherein the specific scene comprises at least a near light scene, a combined press scene, and a voice wake scene; wherein,,
the proximity light scene is a scene triggered by a screen being blocked while the electronic device is in a talk state,
the combined press scene is a scene triggered by the user pressing the power key and other keys simultaneously,
the voice wake-up scene is a scene in which the user presses the power key for a long time to trigger man-machine voice interaction.
6. The method according to any one of claims 1 to 4, wherein the performing the on-off screen fault detection operation based on the first on-off state and the second on-off state when the timing of the timer reaches a specified duration includes:
determining whether the first on-off state and the second on-off state are the same when the timing of the timer reaches a specified duration;
if the first on-off state and the second on-off state are the same, determining that the screen of the electronic equipment fails;
and if the first on-off state and the second on-off state are different, determining that the screen of the electronic equipment is not in fault.
7. A fault detection method, applied to an electronic device, the method comprising:
responding to the pressing operation of a user on a power key of the electronic equipment, starting a timer, and enabling the electronic equipment to be in an AOD display state before the pressing operation is received;
setting the on-off state of the screen of the electronic equipment to be an off-screen state before the power key is pressed, and taking the set on-off state as a first on-off state;
acquiring a second on-off state when the timing of the timer reaches a specified duration, wherein the second on-off state is the on-off state of the screen of the electronic equipment when the timing of the timer reaches the specified duration after the power key is pressed;
and performing a bright-out screen fault detection operation based on the first bright-out state and the second bright-out state.
8. The method of claim 7, wherein the pressing operation comprises a pressing operation and a lifting operation, and wherein the starting a timer in response to a pressing operation of a power key of the electronic device by a user comprises:
and responding to the pressing operation of the power key of the electronic equipment by a user, and directly starting the timer.
9. The method of claim 8, wherein the starting a timer in response to a user pressing a power key of the electronic device comprises:
responding to the pressing operation of a user on a power key of the electronic equipment, determining whether a scene where the electronic equipment is located is a specific scene, and when the pressing operation is received under the specific scene, the on-off state of a screen of the electronic equipment is not changed;
and if the scene where the electronic equipment is located is not the specific scene, starting the timer.
10. The method according to claim 9, wherein the method further comprises:
and if the scene where the electronic equipment is located is the specific scene, not executing the operation of detecting the on-off screen fault.
11. The method according to claim 9 or 10, wherein the specific scenes comprise at least a near light scene, a combined press scene and a voice wake scene; wherein,,
the proximity light scene is a scene triggered by a screen being blocked while the electronic device is in a talk state,
the combined press scene is a scene triggered by the user pressing the power key and other keys simultaneously,
The voice wake-up scene is a scene in which the user presses the power key for a long time to trigger man-machine voice interaction.
12. The method according to any one of claims 7 to 10, wherein the performing the on-off screen fault detection operation based on the first on-off state and the second on-off state includes:
determining whether the first and second on-off states are the same;
if the first on-off state and the second on-off state are the same, determining that the screen of the electronic equipment fails;
and if the first on-off state and the second on-off state are different, determining that the screen of the electronic equipment is not in fault.
13. An electronic device, comprising:
one or more processors;
a memory;
and one or more computer programs, wherein the one or more computer programs are stored on the memory, which when executed by the one or more processors, cause the electronic device to perform the steps of:
responding to the pressing operation of a user on a power key of the electronic equipment, starting a timer, and enabling the electronic equipment to enter an AOD display state after receiving the pressing operation;
Acquiring a first on-off state, wherein the first on-off state is the on-off state of the screen of the electronic equipment before the power key is pressed;
setting a second on-off state to be an off-screen state, wherein the second on-off state is used for representing the on-off state of the screen of the electronic equipment after the power key is pressed;
and performing a bright-out screen fault detection operation based on the first bright-out state and the second bright-out state when the timing of the timer reaches a specified duration.
14. The device of claim 13, wherein the pressing operation comprises a pressing operation and a lifting operation, which when executed by the one or more processors, cause the electronic device to perform the steps of:
determining whether the electronic equipment is in a bright screen state or not in response to the pressing operation of a power key of the electronic equipment by a user;
and if the electronic equipment is in a bright screen state, starting the timer when the lifting operation is received.
15. The device of claim 13, wherein the computer program, when executed by the one or more processors, causes the electronic device to perform the steps of:
Responding to the pressing operation of a user on a power key of the electronic equipment, determining whether a scene where the electronic equipment is located is a specific scene, and when the pressing operation is received under the specific scene, the on-off state of a screen of the electronic equipment is not changed;
and if the scene where the electronic equipment is located is not the specific scene, starting the timer.
16. The device of claim 15, wherein the computer program, when executed by the one or more processors, causes the electronic device to perform the steps of:
and if the scene where the electronic equipment is located is the specific scene, not executing the operation of detecting the on-off screen fault.
17. The device of claim 15 or 16, wherein the specific scene comprises at least a near light scene, a combined press scene, and a voice wake scene; the electronic equipment is characterized in that the near light scene is triggered by shielding a screen when the electronic equipment is in a call state, the combined pressing scene is triggered by the user pressing the power key and other keys at the same time, and the voice awakening scene is triggered by the user pressing the power key for a long time.
18. The device of any of claims 13 to 16, wherein the computer program, when executed by the one or more processors, causes the electronic device to perform the steps of:
determining whether the first on-off state and the second on-off state are the same when the timing of the timer reaches a specified duration;
if the first on-off state and the second on-off state are the same, determining that the screen of the electronic equipment fails;
and if the first on-off state and the second on-off state are different, determining that the screen of the electronic equipment is not in fault.
19. An electronic device, comprising:
one or more processors;
a memory;
and one or more computer programs, wherein the one or more computer programs are stored on the memory, which when executed by the one or more processors, cause the electronic device to perform the steps of:
responding to the pressing operation of a user on a power key of the electronic equipment, starting a timer, and enabling the electronic equipment to be in an AOD display state before the pressing operation is received;
setting the on-off state of the screen of the electronic equipment to be an off-screen state before the power key is pressed, and taking the set on-off state as a first on-off state;
Acquiring a second on-off state when the timing of the timer reaches a specified duration, wherein the second on-off state is the on-off state of the screen of the electronic equipment when the timing of the timer reaches the specified duration after the power key is pressed;
and performing a bright-out screen fault detection operation based on the first bright-out state and the second bright-out state.
20. The device of claim 19, wherein the computer program, when executed by the one or more processors, causes the electronic device to perform the steps of:
and responding to the pressing operation of the power key of the electronic equipment by a user, and directly starting the timer.
21. The device of claim 20, wherein the computer program, when executed by the one or more processors, causes the electronic device to perform the steps of:
responding to the pressing operation of a user on a power key of the electronic equipment, determining whether a scene where the electronic equipment is located is a specific scene, and when the pressing operation is received under the specific scene, the on-off state of a screen of the electronic equipment is not changed;
and if the scene where the electronic equipment is located is not the specific scene, starting the timer.
22. The device of claim 21, wherein the computer program, when executed by the one or more processors, causes the electronic device to perform the steps of:
and if the scene where the electronic equipment is located is the specific scene, not executing the operation of detecting the on-off screen fault.
23. The device of claim 21 or 22, wherein the specific scene comprises at least a near light scene, a combined press scene, and a voice wake scene; the electronic equipment is characterized in that the near light scene is triggered by shielding a screen when the electronic equipment is in a call state, the combined pressing scene is triggered by the user pressing the power key and other keys at the same time, and the voice awakening scene is triggered by the user pressing the power key for a long time.
24. The device of any of claims 19 to 22, wherein the computer program, when executed by the one or more processors, causes the electronic device to perform the steps of:
determining whether the first and second on-off states are the same;
if the first on-off state and the second on-off state are the same, determining that the screen of the electronic equipment fails;
And if the first on-off state and the second on-off state are different, determining that the screen of the electronic equipment is not in fault.
25. A computer readable storage medium comprising a computer program, characterized in that the computer program, when run on an electronic device, causes the electronic device to perform the fault detection method according to any of claims 1-12.
CN202210018485.1A 2022-01-07 2022-01-07 Fault detection method and electronic device Pending CN116450423A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210018485.1A CN116450423A (en) 2022-01-07 2022-01-07 Fault detection method and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210018485.1A CN116450423A (en) 2022-01-07 2022-01-07 Fault detection method and electronic device

Publications (1)

Publication Number Publication Date
CN116450423A true CN116450423A (en) 2023-07-18

Family

ID=87124336

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210018485.1A Pending CN116450423A (en) 2022-01-07 2022-01-07 Fault detection method and electronic device

Country Status (1)

Country Link
CN (1) CN116450423A (en)

Similar Documents

Publication Publication Date Title
WO2023284415A1 (en) Power key mistouch detection method and electronic device
EP4209874A1 (en) Application startup method and apparatus, and electronic device
AU2018456082B2 (en) Stylus detection method, system, and related device
WO2022053006A1 (en) Proximity light sensor control method and related device
EP4138374A1 (en) Fingerprint entry method and electronic device
US20240237115A1 (en) Message Push Method and Apparatus
CN117711310B (en) Display control method, electronic device and storage medium
CN116048350A (en) Screen capture method and electronic device
CN114500732B (en) Interface display method, electronic equipment and storage medium
CN114201738B (en) Unlocking method and electronic device
CN111381996B (en) Memory exception handling method and device
US20240184350A1 (en) Display screen control method and electronic device
WO2023273856A1 (en) Wake-up method and system
CN115016868A (en) Screen control method and terminal equipment
CN116450423A (en) Fault detection method and electronic device
CN114375027B (en) Method and device for reducing power consumption
CN110737916A (en) Communication terminal and processing method
CN112764812B (en) Electronic device and control method thereof
CN117130701A (en) An application icon display method and electronic device
CN114690985B (en) Display method and electronic equipment
CN111475363B (en) Card death recognition method and electronic equipment
CN116450424A (en) Fault detection method and electronic equipment
CN112351144A (en) Mobile terminal and state prompting method thereof
CN114690924A (en) False touch prevention locking method, terminal device and computer readable storage medium
CN106060274A (en) Method and device for reporting ambient light sensor data and mobile terminal

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
CB02 Change of applicant information

Country or region after: China

Address after: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040

Applicant after: Honor Terminal Co.,Ltd.

Address before: 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong

Applicant before: Honor Device Co.,Ltd.

Country or region before: China

CB02 Change of applicant information