Sensor detection method and device, electronic equipment, storage medium and air conditioner
By detecting the output signal of the Hall sensor on the air conditioning panel and matching it with the preset installation status information, the problem of cumbersome detection process of the air conditioning panel is solved, and fast and efficient sensor failure detection is achieved.
Patent Information
- Application Number
- CN202311065878.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-22
- Publication Date
- 2025-02-25
AI Technical Summary
The production line detection process of Hall sensors by air conditioning panels in the prior art is cumbersome and time-consuming, which is not conducive to batch inspection.
By detecting the target detection signal output by the target sensor on the electronic device, and determining whether the target sensor is malfunctioning based on the target detection signal and pre-set installation status information. This method does not require dismantling the target components, and can directly determine whether the sensor is faulty and improve detection efficiency.
It simplifies the sensor detection process, reduces detection time, improves the detection efficiency of sensors, and is suitable for batch inspection of air conditioners and other electronic equipment.
Smart Images

Figure CN119509006A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of terminal technology, and in particular to a sensor detection method, device, electronic device, storage medium and air conditioner. Background Art
[0002] During the production stage of air conditioners, it is necessary to perform functional tests on key components of air conditioners. In recent years, some manufacturers have applied Hall sensors to the installation detection of air conditioner panels. By installing a magnet on the air conditioner panel, when the air conditioner panel is close to or away from the controller, it will generate a magnetic field to change the input state of the air conditioner controller's IO port. The input state of the air conditioner controller's IO port can be used to determine whether the air conditioner panel is installed.
[0003] In the related art, when testing the Hall sensor on the production line, it is usually necessary to remove the air conditioner panel and move it away and then reinstall it close to determine whether the Hall sensor is faulty based on the change in the level of the IO port corresponding to the Hall sensor. However, this detection process is relatively cumbersome and time-consuming, which is not conducive to batch detection. Summary of the invention
[0004] In order to overcome the problems existing in the related art, the present disclosure provides a sensor detection method, device, electronic device, storage medium and air conditioner.
[0005] According to a first aspect of an embodiment of the present disclosure, a sensor detection method is provided, the method comprising:
[0006] Detecting a target detection signal output by a target sensor on the electronic device;
[0007] Based on the target detection signal and pre-set installation status information, determine whether the target sensor is faulty, the installation status information is used to characterize the actual installation status of the target component, the installation status is used to characterize whether the target component is installed on the electronic device, and the target detection signal is used to indicate the installation status detected by the target sensor.
[0008] Optionally, determining whether the target sensor is faulty according to the target detection signal and preset installation status information includes:
[0009] In a case where the target installation state indicated by the target detection signal matches the actual installation state indicated by the installation state information, determining that the target sensor has not failed; or,
[0010] In a case where the target installation state indicated by the target detection signal does not match the actual installation state indicated by the installation state information, it is determined that the target sensor fails.
[0011] Optionally, the method further comprises:
[0012] Obtaining a first duration of the target installation state;
[0013] When the target installation state indicated by the target detection signal does not match the actual installation state indicated by the installation state information, determining that the target sensor fails includes:
[0014] When the target installation state is different from the actual installation state and / or the first duration is less than a first preset duration, it is determined that the target sensor fails.
[0015] Optionally, when the target installation state indicated by the target detection signal matches the actual installation state indicated by the installation state information, determining that the target sensor has not failed includes:
[0016] When the target installation state is the same as the actual installation state and the first duration is greater than or equal to the first preset duration, it is determined that the target sensor is not faulty.
[0017] Optionally, the target detection signal output by the target sensor on the detection electronic device includes:
[0018] When the electronic device operates in a preset detection period, the target detection signal output by the target sensor is detected; the preset detection period includes: a second preset time period from the time when the electronic device is powered on for the first time.
[0019] Optionally, the method further comprises:
[0020] When the electronic device operates outside the preset detection period, whether the target sensor is faulty is determined based on the historical detection signal of the target sensor and the target detection signal; the historical detection signal is the detection signal most recently output by the target sensor before the current moment.
[0021] Optionally, determining whether the target sensor is faulty according to the historical detection signal of the target sensor and the target detection signal includes:
[0022] In a case where the target installation state indicated by the target detection signal does not match the historical installation state indicated by the historical detection signal, it is determined that the target sensor is not faulty.
[0023] Optionally, the method further comprises:
[0024] Obtaining a second duration of the target installation state;
[0025] In the case where the target installation state indicated by the target detection signal does not match the historical installation state indicated by the historical detection signal, determining that the target sensor has not failed includes:
[0026] When the target installation state is different from the historical installation state and the second duration is greater than or equal to a third preset duration, it is determined that the target sensor is not faulty.
[0027] Optionally, the method further comprises:
[0028] The status information of the target sensor is sent to a terminal, and the terminal is used to display the status information of the target sensor, where the status information is used to indicate whether the target sensor is faulty.
[0029] Optionally, the target sensor is a Hall sensor.
[0030] According to a second aspect of an embodiment of the present disclosure, a sensor detection device is provided, the device comprising:
[0031] A detection module, configured to detect a target detection signal output by a target sensor on the electronic device;
[0032] The first determination module is configured to determine whether the target sensor is faulty based on the target detection signal and pre-set installation status information, the installation status information is used to characterize the actual installation status of the target component, the installation status is used to characterize whether the target component is installed on the electronic device, and the target detection signal is used to indicate the installation status detected by the target sensor.
[0033] Optionally, the first determining module is configured to:
[0034] In a case where the target installation state indicated by the target detection signal matches the actual installation state indicated by the installation state information, determining that the target sensor has not failed; or,
[0035] In a case where the target installation state indicated by the target detection signal does not match the actual installation state indicated by the installation state information, it is determined that the target sensor fails.
[0036] Optionally, the device further comprises:
[0037] A first acquisition module is configured to acquire a first duration of the target installation state;
[0038] The first determining module is configured to:
[0039] When the target installation state is different from the actual installation state and / or the first duration is less than a first preset duration, it is determined that the target sensor fails.
[0040] Optionally, the first determining module is configured to:
[0041] When the target installation state is the same as the actual installation state and the first duration is greater than or equal to the first preset duration, it is determined that the target sensor is not faulty.
[0042] Optionally, the detection module is configured to:
[0043] When the electronic device operates in a preset detection period, the target detection signal output by the target sensor is detected; the preset detection period includes: a second preset time period from the time when the electronic device is powered on for the first time.
[0044] Optionally, the device further comprises:
[0045] The second determination module is configured to determine whether the target sensor is faulty based on the historical detection signal of the target sensor and the target detection signal when the electronic device operates outside the preset detection period; the historical detection signal is the detection signal output by the target sensor most recently before the current moment.
[0046] Optionally, the second determining module is configured to:
[0047] In a case where the target installation state indicated by the target detection signal does not match the historical installation state indicated by the historical detection signal, it is determined that the target sensor is not faulty.
[0048] Optionally, the device further comprises:
[0049] A second acquisition module is configured to acquire a second duration of the target installation state;
[0050] The second determining module is configured to:
[0051] When the target installation state is different from the historical installation state and the second duration is greater than or equal to a third preset duration, it is determined that the target sensor is not faulty.
[0052] Optionally, the device further comprises:
[0053] The sending module is configured to send the status information of the target sensor to a terminal, where the terminal is used to display the status information of the target sensor, and the status information is used to indicate whether the target sensor is faulty.
[0054] Optionally, the target sensor is a Hall sensor.
[0055] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:
[0056] processor;
[0057] a memory for storing processor-executable instructions;
[0058] The processor is configured to execute the method described in the first aspect of the embodiment of the present disclosure.
[0059] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored. When the program instructions are executed by a processor, the steps of the method described in the first aspect of the embodiment of the present disclosure are implemented.
[0060] According to a fifth aspect of an embodiment of the present disclosure, an air conditioner is provided, comprising the electronic device described in the fourth aspect of an embodiment of the present disclosure.
[0061] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:
[0062] The present disclosure first detects a target detection signal output by a target sensor on an electronic device, and then determines whether the target sensor is faulty based on the target detection signal and pre-set installation status information. The installation status information is used to characterize the actual installation status of the target component, the installation status is used to characterize whether the target component is installed on the electronic device, and the target detection signal is used to indicate the installation status detected by the target sensor. The present disclosure determines whether the target sensor is faulty based on the target detection signal output by the target sensor and the pre-set installation status information, without the need to dismantle or move the target component, and can improve the detection efficiency of the target sensor.
[0063] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0065] Figure 1 is a schematic diagram showing a sensor detection principle according to an exemplary embodiment;
[0066] Figure 2 is a flow chart of a sensor detection method according to an exemplary embodiment;
[0067] Figure 3 is a flow chart of another sensor detection method according to an exemplary embodiment;
[0068] Figure 4 is a flow chart of another sensor detection method according to an exemplary embodiment;
[0069] Figure 5 is a flow chart of another sensor detection method according to an exemplary embodiment;
[0070] Figure 6 is a flow chart of another sensor detection method according to an exemplary embodiment;
[0071] Figure 7 is a block diagram of a sensor detection device according to an exemplary embodiment;
[0072] Figure 8 is a block diagram of another sensor detection device according to an exemplary embodiment;
[0073] Fig. 9 is a block diagram of another sensor detection device according to an exemplary embodiment;
[0074] Fig.10 is a block diagram of another sensor detection device according to an exemplary embodiment;
[0075] Fig.11 is a block diagram of another sensor detection device according to an exemplary embodiment;
[0076] Fig.12 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0077] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0078] Before introducing the sensor detection method, device, electronic device, storage medium and air conditioner shown in the embodiments of the present disclosure, the application scenarios involved in the embodiments of the present disclosure are first introduced.
[0079] In the related art, when the Hall sensor is tested on the production line, the air conditioner panel is already installed before the air conditioner is powered on for the first time. After the air conditioner is powered on, the level of the IO port corresponding to the Hall sensor will not change. Therefore, when testing, the air conditioner panel needs to be removed and moved away, and then installed again. Figure 1 As shown, when the air-conditioning panel with magnetic material is close to the air-conditioning controller within the control range (for example <20mm), the Hall sensor circuit is turned on, thereby changing the electrical level of the IO port corresponding to the Hall sensor. Based on the change in the electrical level of the IO port corresponding to the Hall sensor, it can be determined whether the Hall sensor is faulty.
[0080] Figure 2 is a flow chart of a sensor detection method according to an exemplary embodiment. Figure 2 As shown, the method comprises the following steps:
[0081] In step 101, a target detection signal output by a target sensor on an electronic device is detected.
[0082] In step 102, it is determined whether the target sensor is faulty based on the target detection signal and pre-set installation status information, the installation status information is used to characterize the actual installation status of the target component, the installation status is used to characterize whether the target component is installed on the electronic device, and the target detection signal is used to indicate the installation status detected by the target sensor.
[0083] For example, the target sensor in the present disclosure may be any sensor that can detect displacement, such as a Hall sensor, and the electronic device may be any device equipped with a target sensor, such as an air conditioner, a refrigerator, a vehicle, etc. Taking the electronic device as an air conditioner as an example, the target component may be an air conditioner panel, and the target sensor may be used to detect the installation status of the air conditioner panel.
[0084] In the related art, it is usually determined whether the target sensor has failed by changing the installation state of the target component and detecting whether the target sensor has detected the change in the installation state of the target component. The operation is cumbersome and not conducive to large-scale detection. In the present disclosure, an installation state information can be pre-set, wherein the installation state information is used to characterize the actual installation state of the target component, and the installation state is used to characterize whether the target component is installed on the electronic device. The installation state may include an installed state and an uninstalled state. Based on the target detection signal output by the target sensor and the pre-set installation state information, it is possible to determine whether the target sensor has failed without removing the target component, thereby improving the detection efficiency of the target sensor.
[0085] For example, a low level output by the target sensor may indicate that the target component is in an installed state, that is, the target component is installed on the electronic device, and a high level signal output by the target sensor may indicate that the target component is in an uninstalled state, that is, the target component is not installed on the electronic device. The installation state indicated by the pre-set installation state information may be an installed state, and accordingly, the low level signal may be pre-set as the installation state information. When the target sensor is tested in large quantities, the target component may be pre-installed on the electronic device for all electronic devices to be tested, and then the target sensor may be tested. The installation state indicated by the pre-set installation state information may also be an uninstalled state, and accordingly, the high level signal may be pre-set as the installation state information. When the target sensor is tested in large quantities, the target sensor may be tested when the target component is not installed on the electronic device for all electronic devices to be tested.
[0086] In some embodiments, first, a target detection signal output by a target sensor on an electronic device can be detected, wherein the target detection signal is used to indicate the installation state detected by the target sensor. If the target installation state indicated by the target detection signal output by the target sensor matches the actual installation state indicated by the installation state information, indicating that the target installation state correctly indicates the installation state of the target component, then it can be considered that the target detection signal output by the target sensor is correct, and the detection function of the target sensor is normal, so that it can be determined that the target sensor has not failed. Correspondingly, if the target installation state indicated by the target detection signal output by the target sensor does not match the actual installation state indicated by the installation state information, indicating that the target installation state incorrectly indicates the installation state of the target component, then it can be considered that the target detection signal output by the target sensor is wrong, and the detection function of the target sensor is abnormal, so that it can be determined that the target sensor has failed. In this way, there is no need to remove the target component and then move it far away and then close it. It can be directly determined whether the target sensor has failed through the target detection signal output by the target sensor. The operation process is simple, and the detection efficiency of the target sensor can be improved, thereby realizing mass detection of sensors installed on electronic devices.
[0087] In other embodiments, after the state information of the target sensor is detected, the state information can be sent to the terminal so that the terminal displays the state information of the target sensor, wherein the state information is used to indicate whether the target sensor is faulty. The state information can be sent to the terminal multiple times (for example, 3 times) to ensure that the terminal successfully receives the state information of the target sensor.
[0088] In summary, the present disclosure first detects the target detection signal output by the target sensor on the electronic device, and then determines whether the target sensor is faulty based on the target detection signal and pre-set installation status information. The installation status information is used to characterize the actual installation status of the target component, the installation status is used to characterize whether the target component is installed on the electronic device, and the target detection signal is used to indicate the installation status detected by the target sensor. The present disclosure determines whether the target sensor is faulty based on the target detection signal output by the target sensor and the pre-set installation status information, without the need to dismantle or move the target component, and can improve the detection efficiency of the target sensor.
[0089] Figure 3 is a flow chart of another sensor detection method according to an exemplary embodiment. Figure 3 As shown, step 102 can be implemented by the following steps:
[0090] In step 1021, when the target installation state indicated by the target detection signal matches the actual installation state indicated by the installation state information, it is determined that the target sensor has not failed.
[0091] In step 1022, when the target installation state indicated by the target detection signal does not match the actual installation state indicated by the installation state information, it is determined that the target sensor fails.
[0092] For example, when detecting the target sensor, if the target installation state indicated by the target detection signal output by the target sensor matches the actual installation state indicated by the installation state information, then the target detection signal output by the target sensor can be considered to be correct, and thus it can be determined that the target sensor has not failed. Correspondingly, if the target installation state indicated by the target detection signal output by the target sensor does not match the actual installation state indicated by the installation state information, then it can be considered that the target detection signal output by the target sensor is incorrect, and thus it can be determined that the target sensor has failed. In this way, there is no need to remove the target component and move it far away and then close it again. Whether the target sensor has failed can be determined directly through the target detection signal output by the target sensor, which can improve the detection efficiency of the target sensor.
[0093] In other embodiments, when the target installation state is the same as the actual installation state, it can be considered that the target installation state matches the actual installation state. Taking the actual installation state indicated by the installation state information as the installed state as an example, if the target installation state indicated by the target detection signal is also the installed state, then it can be considered that the target installation state matches the actual installation state, and if the target installation state indicated by the target detection signal is the not installed state, then it can be considered that the target installation state does not match the actual installation state.
[0094] Figure 4 is a flow chart of another sensor detection method according to an exemplary embodiment. Figure 4 As shown, the method may also include:
[0095] In step 103, a first duration of the target installation state is obtained.
[0096] Accordingly, one implementation of step 1022 may be:
[0097] When the target installation state is different from the actual installation state and / or the first duration is less than a first preset duration, it is determined that the target sensor fails.
[0098] One implementation of step 1021 may be:
[0099] When the target installation state is the same as the actual installation state and the first duration is greater than or equal to the first preset duration, it is determined that the target sensor has not failed.
[0100] For example, while detecting the target detection signal output by the target sensor, the first duration of the target installation state indicated by the target detection signal can be recorded. If the target installation state indicated by the target detection signal is the same as the actual installation state indicated by the installation state information, and the first duration of the target installation state is greater than or equal to the first preset duration, it means that the target detection signal output by the target sensor over a long period of time correctly indicates the installation state of the target component. Then, it can be considered that the target installation state matches the actual installation state, thereby determining that the target sensor has not failed, which can further improve the accuracy of the detection. Among them, the first preset duration can be 50ms.
[0101] If the following three situations occur, it can be considered that the target installation state does not match the actual installation state, and thus it is determined that the target sensor has failed. Situation 1: The target installation state is the same as the actual installation state, but the first duration of the target installation state is less than the first preset duration; Situation 2: The target installation state is different from the actual installation state, and the first duration of the target installation state is less than the first preset duration; Situation 3: The target installation state is different from the actual installation state, and the first duration of the target installation state is greater than the first preset duration.
[0102] Taking the case where the target sensor outputs a low-level signal to indicate that the target component is in an installed state, the actual installation state indicated by the installation state information is in an installed state, and the first preset duration is 50ms as an example, if the target detection signal is a low-level signal, that is, the target installation state indicated by the target detection signal is in an installed state, and the duration of the low-level signal is greater than or equal to 50ms, then it can be determined that the target sensor is not faulty. If the target detection signal is a high-level signal, that is, the target installation state indicated by the target detection signal is in an uninstalled state, or the target detection signal is a low-level signal, but the duration of the low-level signal is less than 50ms, then it can be determined that the target sensor is faulty.
[0103] Figure 5 is a flow chart of another sensor detection method according to an exemplary embodiment. Figure 5 As shown, one implementation of step 101 may be:
[0104] When the electronic device is running in a preset detection period, the target detection signal output by the target sensor is detected. The preset detection period includes: a second preset time period from the moment when the electronic device is powered on for the first time.
[0105] The method may further include:
[0106] In step 104, when the electronic device operates outside the preset detection period, it is determined whether the target sensor is faulty according to the historical detection signal of the target sensor and the target detection signal. The historical detection signal is the detection signal output by the target sensor most recently before the current moment.
[0107] For example, a period within a second preset time period from the moment the electronic device is powered on for the first time can be set in advance as a preset detection period. The first power-on can be understood as the first time the electronic device is powered on after being connected to a power source. After the electronic device is powered on, it can be first determined whether the electronic device is powered on for the first time. If the electronic device is powered on for the first time, the power-on time of the electronic device can be recorded. If the power-on time is less than or equal to the second preset time period, the target detection signal output by the target sensor can be continuously detected, and it can be determined whether the target sensor fails according to step 102.
[0108] If the electronic device is running outside the preset detection period, that is, the electronic device is not powered on for the first time, or the power-on time after the electronic device is powered on for the first time is greater than the second preset time, then it can be determined whether the target sensor is faulty based on the historical detection signal of the target sensor and the target detection signal, wherein the historical detection signal is the detection signal output by the target sensor most recently before the current moment. In this way, if it is not successfully detected whether the target sensor is faulty within the preset detection period, the historical detection signal can be used to perform a secondary detection on the target sensor.
[0109] It should be noted that, during the user's use of the electronic device, if the electronic device is running outside the preset detection period, the target sensor can detect the current installation state of the target component. If the current installation state is different from the historical installation state indicated by the historical detection signal, it means that the installation state of the target component has changed, then the operation state of the designated component in the electronic device can be controlled. In this way, the normal use of the user-side function can be guaranteed during the user's use of the electronic device. For example, if the electronic device is an air conditioner, the target component is an air conditioner panel, and the designated component is an internal fan and a UVC (English: UltraViolet C radiation, Chinese: short-wave ultraviolet) lamp, if the historical installation state is an installed state and the current installation state is an uninstalled state, it means that the user has opened the air conditioner panel, then the internal fan and UVC lamp can be controlled to be turned off to ensure the user's safety; if the historical installation state is an uninstalled state and the current installation state is an installed state, it means that the user has closed the air conditioner panel, then the internal fan and UVC lamp can be controlled to be turned on again to make the air conditioner run normally.
[0110] According to an embodiment shown in the present disclosure, an implementation manner of step 104 may be:
[0111] In the event that the target installation state indicated by the target detection signal does not match the historical installation state indicated by the historical detection signal, it is determined that the target sensor is not faulty.
[0112] For example, if the target sensor is not successfully detected as faulty within the preset detection period, the target component can be removed and moved away, and then the target installation state indicated by the target detection signal and the historical installation state indicated by the historical detection signal during the movement of the target component can be used to determine whether the target sensor is faulty. If the target installation state does not match the historical installation state, it can be determined that the target detection signal output by the target sensor correctly indicates the installation state of the target component, and the target sensor detects the change in the installation state of the target component, so that it can be determined that the target sensor is not faulty. If the target installation state matches the historical installation state, it can be determined that the target detection signal output by the target sensor incorrectly indicates the installation state of the target component, and the target sensor does not detect the change in the installation state of the target component, so that it can be determined that the target sensor is faulty.
[0113] Figure 6 is a flow chart of another sensor detection method according to an exemplary embodiment. Figure 6 As shown, the method may also include:
[0114] In step 105, when the electronic device operates outside the preset detection period, a second duration of the target installation state is obtained.
[0115] Accordingly, another implementation of step 104 may be:
[0116] When the target installation state is different from the historical installation state and the second duration is greater than or equal to a third preset duration, it is determined that the target sensor is not faulty.
[0117] For example, when the electronic device is operating outside the preset detection period, while detecting the target detection signal output by the target sensor, the second duration of the target installation state indicated by the target detection signal can be recorded. If the target installation state indicated by the target detection signal is different from the historical installation state indicated by the installation state information, and the second duration of the target installation state is greater than or equal to the third preset duration, it means that the target sensor accurately detects the change in the installation state of the target component, then it can be determined that the target sensor has not failed. Among them, the third preset duration can be 50ms. If the target installation state is the same as the historical installation state, it means that the target sensor has not detected the change in the installation state of the target component, then it can be considered that the target sensor has failed.
[0118] In summary, the present disclosure first detects the target detection signal output by the target sensor on the electronic device, and then determines whether the target sensor is faulty based on the target detection signal and pre-set installation status information. The installation status information is used to characterize the actual installation status of the target component, the installation status is used to characterize whether the target component is installed on the electronic device, and the target detection signal is used to indicate the installation status detected by the target sensor. The present disclosure determines whether the target sensor is faulty based on the target detection signal output by the target sensor and the pre-set installation status information, without the need to dismantle or move the target component, and can improve the detection efficiency of the target sensor.
[0119] Figure 7 is a block diagram of a sensor detection device according to an exemplary embodiment. Figure 7 As shown, the device 200 includes:
[0120] The detection module 201 is configured to detect a target detection signal output by a target sensor on the electronic device.
[0121] The first determination module 202 is configured to determine whether the target sensor is faulty based on the target detection signal and pre-set installation status information, the installation status information is used to characterize the actual installation status of the target component, the installation status is used to characterize whether the target component is installed on the electronic device, and the target detection signal is used to indicate the installation status detected by the target sensor.
[0122] According to some embodiments of the present disclosure, the first determining module 202 is configured to:
[0123] When the target installation state indicated by the target detection signal matches the actual installation state indicated by the installation state information, it is determined that the target sensor has not failed.
[0124] In the event that the target installation state indicated by the target detection signal does not match the actual installation state indicated by the installation state information, it is determined that the target sensor has failed.
[0125] Figure 8 is a block diagram of another sensor detection device according to an exemplary embodiment. Figure 8 As shown, the device 200 also includes:
[0126] The first acquisition module 203 is configured to acquire a first duration of the target installation state.
[0127] The first determining module 202 is configured to:
[0128] When the target installation state is different from the actual installation state and / or the first duration is less than a first preset duration, it is determined that the target sensor fails.
[0129] According to some other embodiments of the present disclosure, the first determining module 202 is configured to:
[0130] When the target installation state is the same as the actual installation state and the first duration is greater than or equal to the first preset duration, it is determined that the target sensor has not failed.
[0131] According to some other embodiments of the present disclosure, the detection module 201 is configured to:
[0132] When the electronic device is running in a preset detection period, the target detection signal output by the target sensor is detected. The preset detection period includes: a second preset time period from the moment when the electronic device is powered on for the first time.
[0133] Fig. 9 is a block diagram of another sensor detection device according to an exemplary embodiment. Fig. 9 As shown, the device 200 also includes:
[0134] The second determination module 204 is configured to determine whether the target sensor is faulty based on the historical detection signal of the target sensor and the target detection signal when the electronic device is operating outside the preset detection period. The historical detection signal is the detection signal output by the target sensor most recently before the current moment.
[0135] According to some other embodiments of the present disclosure, the second determining module 204 is configured to:
[0136] In the event that the target installation state indicated by the target detection signal does not match the historical installation state indicated by the historical detection signal, it is determined that the target sensor is not faulty.
[0137] Fig.10 is a block diagram of another sensor detection device according to an exemplary embodiment. Fig.10 As shown, the device 200 also includes:
[0138] The second acquisition module 205 is configured to acquire a second duration of the target installation state.
[0139] The second determining module 204 is configured to:
[0140] When the target installation state is different from the historical installation state and the second duration is greater than or equal to a third preset duration, it is determined that the target sensor is not faulty.
[0141] Fig.11 is a block diagram of another sensor detection device according to an exemplary embodiment. Fig.11 As shown, the device 200 also includes:
[0142] The sending module 206 is configured to send the status information of the target sensor to the terminal, and the terminal is used to display the status information of the target sensor, and the status information is used to indicate whether the target sensor is faulty.
[0143] According to some other embodiments of the present disclosure, the target sensor is a Hall sensor.
[0144] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0145] In summary, the present disclosure first detects the target detection signal output by the target sensor on the electronic device, and then determines whether the target sensor is faulty based on the target detection signal and pre-set installation status information. The installation status information is used to characterize the actual installation status of the target component, the installation status is used to characterize whether the target component is installed on the electronic device, and the target detection signal is used to indicate the installation status detected by the target sensor. The present disclosure determines whether the target sensor is faulty based on the target detection signal output by the target sensor and the pre-set installation status information, without the need to dismantle or move the target component, and can improve the detection efficiency of the target sensor.
[0146] The present disclosure also provides a computer-readable storage medium having computer program instructions stored thereon, and when the program instructions are executed by a processor, the steps of the sensor detection method provided by the present disclosure are implemented.
[0147] Fig.12 3 is a block diagram of an electronic device according to an exemplary embodiment. For example, the electronic device 300 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0148] Reference Fig.12 , the electronic device 300 may include one or more of the following components: a processing component 302 , a memory 304 , a power component 306 , a multimedia component 308 , an audio component 310 , an input / output interface 312 , a sensor component 314 , and a communication component 316 .
[0149] The processing component 302 generally controls the overall operation of the electronic device 300, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 302 may include one or more processors 320 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 302 may include one or more modules to facilitate the interaction between the processing component 302 and other components. For example, the processing component 302 may include a multimedia module to facilitate the interaction between the multimedia component 308 and the processing component 302.
[0150] The memory 304 is configured to store various types of data to support operations on the electronic device 300. Examples of such data include instructions for any application or method operating on the electronic device 300, contact data, phone book data, messages, pictures, videos, etc. The memory 304 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0151] The power supply component 306 provides power to the various components of the electronic device 300. The power supply component 306 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 300.
[0152] The multimedia component 308 includes a screen that provides an output interface between the electronic device 300 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 308 includes a front camera and / or a rear camera. When the electronic device 300 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0153] The audio component 310 is configured to output and / or input audio signals. For example, the audio component 310 includes a microphone (MIC), and when the electronic device 300 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 304 or sent via the communication component 316. In some embodiments, the audio component 310 also includes a speaker for outputting audio signals.
[0154] The input / output interface 312 provides an interface between the processing component 302 and the peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0155] The sensor assembly 314 includes one or more sensors for providing various aspects of status assessment for the electronic device 300. For example, the sensor assembly 314 can detect the open / closed state of the electronic device 300, the relative positioning of components, such as the display and keypad of the electronic device 300, and the sensor assembly 314 can also detect the position change of the electronic device 300 or a component of the electronic device 300, the presence or absence of user contact with the electronic device 300, the orientation or acceleration / deceleration of the electronic device 300, and the temperature change of the electronic device 300. The sensor assembly 314 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 314 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 314 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0156] The communication component 316 is configured to facilitate wired or wireless communication between the electronic device 300 and other devices. The electronic device 300 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 316 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 316 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0157] In an exemplary embodiment, the electronic device 300 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.
[0158] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 304 including instructions, and the instructions can be executed by a processor 320 of an electronic device 300 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0159] In another exemplary embodiment, a computer program product is further provided. The computer program product includes a computer program that can be executed by a programmable electronic device. The computer program has a code portion for executing the above-mentioned detection method of the sensor when executed by the programmable electronic device.
[0160] The present disclosure also provides an air conditioner, which includes the electronic device 300 shown in the embodiment of the present disclosure.
[0161] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the present disclosure. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered as exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0162] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A sensor detection method, characterized in that: The method comprises: Detecting a target detection signal output by a target sensor on the electronic device; Based on the target detection signal and pre-set installation status information, determine whether the target sensor is faulty, the installation status information is used to characterize the actual installation status of the target component, the installation status is used to characterize whether the target component is installed on the electronic device, and the target detection signal is used to indicate the installation status detected by the target sensor.
2. The method according to claim 1, characterized in that: The determining whether the target sensor is faulty according to the target detection signal and the preset installation status information comprises: In a case where the target installation state indicated by the target detection signal matches the actual installation state indicated by the installation state information, determining that the target sensor has not failed; or, In a case where the target installation state indicated by the target detection signal does not match the actual installation state indicated by the installation state information, it is determined that the target sensor fails.
3. The method according to claim 2, characterized in that The method further comprises: Obtaining a first duration of the target installation state; When the target installation state indicated by the target detection signal does not match the actual installation state indicated by the installation state information, determining that the target sensor fails includes: When the target installation state is different from the actual installation state and / or the first duration is less than a first preset duration, it is determined that the target sensor fails.
4. The method according to claim 3, characterized in that: When the target installation state indicated by the target detection signal matches the actual installation state indicated by the installation state information, determining that the target sensor has not failed includes: When the target installation state is the same as the actual installation state and the first duration is greater than or equal to the first preset duration, it is determined that the target sensor is not faulty.
5. The method according to claim 1, characterized in that The target detection signal output by the target sensor on the detection electronic device includes: When the electronic device operates in a preset detection period, the target detection signal output by the target sensor is detected; the preset detection period includes: a second preset time period from the time when the electronic device is powered on for the first time.
6. The method according to claim 5, characterized in that The method further comprises: When the electronic device operates outside the preset detection period, whether the target sensor is faulty is determined based on the historical detection signal of the target sensor and the target detection signal; the historical detection signal is the detection signal most recently output by the target sensor before the current moment.
7. The method according to claim 6, characterized in that The determining whether the target sensor is faulty according to the historical detection signal of the target sensor and the target detection signal comprises: In a case where the target installation state indicated by the target detection signal does not match the historical installation state indicated by the historical detection signal, it is determined that the target sensor is not faulty.
8. The method according to claim 7, characterized in that The method further comprises: Obtaining a second duration of the target installation state; In the case where the target installation state indicated by the target detection signal does not match the historical installation state indicated by the historical detection signal, determining that the target sensor has not failed includes: When the target installation state is different from the historical installation state and the second duration is greater than or equal to a third preset duration, it is determined that the target sensor is not faulty.
9. The method according to claim 1, characterized in that: The method further comprises: The status information of the target sensor is sent to a terminal, and the terminal is used to display the status information of the target sensor, where the status information is used to indicate whether the target sensor is faulty.
10. The method according to any one of claims 1 to 9, characterized in that The target sensor is a Hall sensor.
11. A sensor detection device, characterized in that: The device comprises: A detection module, configured to detect a target detection signal output by a target sensor on the electronic device; The first determination module is configured to determine whether the target sensor is faulty based on the target detection signal and pre-set installation status information, the installation status information is used to characterize the actual installation status of the target component, the installation status is used to characterize whether the target component is installed on the electronic device, and the target detection signal is used to indicate the installation status detected by the target sensor.
12. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to execute the method according to any one of claims 1 to 10.
13. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the program instructions are executed by a processor, the steps of the method described in any one of claims 1 to 10 are implemented.
14. An air conditioner, characterized in that: The air conditioner includes the electronic device according to claim 12.