Screen state switching method and device, and storage medium
By employing a level-triggered method in the Hall sensor, continuously detecting the level value and determining the target event based on a preset relationship, the problem of misjudgment caused by electromagnetic interference in the Hall sensor in terminal devices is solved, achieving higher accuracy and usability in screen state switching.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING XIAOMI MOBILE SOFTWARE CO LTD
- Filing Date
- 2020-03-20
- Publication Date
- 2026-07-03
AI Technical Summary
Hall effect sensors in terminal devices are prone to misjudging screen state transitions due to electromagnetic interference, and current technology cannot effectively avoid this misjudgment.
The screen state switching is determined by the change in the level value of the target sensor using a level triggering method. Multiple level values are continuously detected to confirm the necessity of switching, and the target event is determined and the switching is performed according to a preset relationship.
It improves the accuracy and usability of screen state switching, reduces misjudgments caused by electromagnetic interference, and ensures the reliability of screen state switching.
Smart Images

Figure CN113495652B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of terminal processing, and in particular to screen state switching methods and apparatus, and storage media. Background Technology
[0002] Currently, to protect the terminal screen or casing, various protective covers made of different materials can be used. Opening or closing the cover turns the terminal screen on or off. Generally, leather is a common material for these covers.
[0003] A Hall sensor is installed on the terminal. When the Hall sensor determines that the outer casing is moving away from the screen, the terminal's screen lights up; when it determines that the outer casing is moving closer to the screen, the screen turns off. The Hall sensor makes its judgment based on changes in the surrounding magnetic field. However, because the terminal may be subject to interference from other magnetic fields, the Hall sensor can easily misjudge the situation, failing to light up or turn off the screen as expected. Summary of the Invention
[0004] In view of this, the present disclosure provides a screen state switching method, apparatus, and storage medium to address the shortcomings of related technologies.
[0005] According to a first aspect of the present disclosure, a screen state switching method is provided, the method comprising:
[0006] Determine whether the voltage level generated by the target sensor has changed;
[0007] If the level value changes, the screen state is switched.
[0008] Optionally, after the level value changes, the method further includes:
[0009] Continuously determine multiple newly generated voltage values from the target sensor;
[0010] Based on the target level value changed by the target sensor and the multiple level values, determine whether it is necessary to switch the screen state;
[0011] After determining that the screen state needs to be switched, the step of switching the screen state is performed.
[0012] Optionally, determining whether to switch the screen state based on the changed target level value from the target sensor and the plurality of level values includes:
[0013] If the multiple level values are the same and the same as the target level value, it is determined that the screen state needs to be switched; otherwise, it is determined that the screen state does not need to be switched.
[0014] Optionally, after the level value changes, the method further includes:
[0015] Based on the preset correspondence between level values and events, determine the target event corresponding to the target level value after the target sensor changes;
[0016] The target event is reported through the target sensor;
[0017] The switching of the screen state includes:
[0018] Based on the preset correspondence between events and screen states, the screen state corresponding to the reported target event is taken as the target screen state.
[0019] Switch the screen state to the target screen state.
[0020] Optionally, the target event includes the target object moving away from the screen or the target object moving closer to the screen.
[0021] According to a second aspect of the present disclosure, a screen state switching device is provided, the device comprising:
[0022] The first determining module is configured to determine whether the voltage level generated by the target sensor has changed.
[0023] The screen state switching module is configured to switch the screen state if the level value changes.
[0024] Optionally, the device further includes:
[0025] The second determining module is configured to continuously determine multiple newly generated level values from the target sensor;
[0026] The third determining module is configured to determine whether the screen state needs to be switched based on the target level value changed by the target sensor and the plurality of level values.
[0027] The control module is configured to control the screen state switching module to switch the screen state after the third determining module determines that the screen state needs to be switched.
[0028] Optionally, the third determining module includes:
[0029] The first determining submodule is configured to determine that the screen state needs to be switched if the plurality of level values are the same and are the same as the target level value; otherwise, it is determined that the screen state does not need to be switched.
[0030] Optionally, the device further includes:
[0031] The event determination module is configured to determine the target event corresponding to the target level value changed by the target sensor based on a preset correspondence between level values and events;
[0032] The event reporting module is configured to report the target event through the target sensor;
[0033] The screen state switching module includes:
[0034] The second determining submodule is configured to take the screen state corresponding to the reported target event as the target screen state based on the preset correspondence between events and screen states.
[0035] The switching submodule is configured to switch the screen state to the target screen state.
[0036] Optionally, the target event includes the target object moving away from the screen or the target object moving closer to the screen.
[0037] According to a third aspect of the present disclosure, a computer-readable storage medium is provided, the storage medium storing a computer program for performing the screen state switching method described in any of the first aspects above.
[0038] According to a fourth aspect of the present disclosure, a screen state switching device is provided, the device comprising:
[0039] processor;
[0040] Memory used to store processor-executable instructions;
[0041] The processor is configured as follows:
[0042] Determine whether the voltage level generated by the target sensor has changed;
[0043] If the level value changes, the screen state is switched.
[0044] The technical solutions provided by the embodiments of this disclosure may include the following beneficial effects:
[0045] In this embodiment of the disclosure, by adopting a level-triggered method, the screen state is switched after the level value of the target sensor changes. This avoids misjudgment caused by electromagnetic interference from the surrounding environment when the target sensor adopts an edge-triggered method, thereby improving the accuracy of screen state switching and increasing its usability.
[0046] In this embodiment, after the target sensor's voltage level changes, multiple newly generated voltage levels from the target sensor can be continuously determined. If these multiple voltage levels are identical and match the changed target voltage level of the target sensor, then it is determined that the screen state needs to be switched; otherwise, it is determined that the screen state does not need to be switched. This further reduces the possibility of false judgments from the target sensor, improves the accuracy of screen state switching, and enhances usability.
[0047] In this embodiment, a target event corresponding to a target level value can be determined based on a preset correspondence between level values and events, and the target event is reported by a target sensor. Subsequently, based on the correspondence between the event and the screen state, the screen state is switched to the target screen state corresponding to the reported target event, which is simple to implement and highly usable.
[0048] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0049] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0050] Figure 1 This disclosure is a schematic diagram illustrating an edge-triggered mode of a Hall sensor according to an exemplary embodiment;
[0051] Figure 2 This disclosure is a flowchart illustrating a screen state switching method according to an exemplary embodiment;
[0052] Figure 3 This disclosure illustrates another screen state switching method according to an exemplary embodiment;
[0053] Figure 4 This disclosure illustrates another screen state switching method according to an exemplary embodiment;
[0054] Figure 5 This disclosure is a block diagram illustrating a screen state switching device according to an exemplary embodiment;
[0055] Figure 6 This is a block diagram of another screen state switching device according to an exemplary embodiment of the present disclosure;
[0056] Figure 7 This is a block diagram of another screen state switching device according to an exemplary embodiment of the present disclosure;
[0057] Figure 8This is a block diagram of another screen state switching device according to an exemplary embodiment of the present disclosure;
[0058] Figure 9 This is a schematic diagram of a screen state switching device according to an exemplary embodiment of the present disclosure. Detailed Implementation
[0059] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0060] The terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The singular forms “a,” “the,” and “the” used in this disclosure and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” used herein refers to and includes any and all possible combinations of one or more of the associated listed items.
[0061] It should be understood that although the terms first, second, third, etc., may be used in this disclosure to describe various information, such information should not be limited to these terms. These terms are used only to distinguish information of the same type from one another. For example, without departing from the scope of this disclosure, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if," as used herein, may be interpreted as "when," "when," or "in response to determination."
[0062] After configuring a protective cover, the user wants to control the screen's on / off state by moving the cover closer to or further away from the screen. A Hall sensor can be pre-installed on the terminal screen; by default, the Hall sensor uses an edge-triggered interrupt mode to trigger event processing.
[0063] Edge-triggered methods, for example Figure 1 As shown, in a Hall sensor, electrons in the vertical direction generate a transverse potential difference under the influence of the Lorentz force of a magnetic field, and the voltage changes with the magnetic field strength. The switch-type Hall sensor sets two threshold values, B1 and B2, based on the change in the magnetic field. When the magnetic field strength is greater than B2, a corresponding voltage level is generated. When the magnetic field strength is less than B1, a corresponding voltage level is generated. When the magnetic field strength is between B1 and B2, the voltage level remains unchanged.
[0064] When a magnet is placed inside the protective cover, and the cover is closed, the magnet approaches the Hall sensor, at which point the magnetic field strength reaches B2. The Hall sensor uses edge triggering as its interrupt triggering method; at the instant the voltage level changes, the Hall sensor reports the corresponding event and triggers screen off.
[0065] When the cover is opened, the magnet inside the cover moves away from the Hall sensor. When the magnet moves away from the Hall sensor to a certain position, the magnetic field strength decreases to B1, and the corresponding level value also changes, triggering the screen to light up.
[0066] However, because edge-triggered sensors are easily disturbed by electromagnetic interference, Hall sensors are prone to misjudgment due to other electromagnetic interference in the terminal environment, resulting in incorrect screen lighting or turning off.
[0067] To address the aforementioned problems, this disclosure provides a screen state switching method that can be used in terminals such as smartphones, tablets, and personal digital assistants (PDAs). Figure 2 As shown, Figure 2 This is a screen state switching method according to an exemplary embodiment, comprising the following steps:
[0068] In step 101, it is determined whether the level value generated by the target sensor has changed.
[0069] In this embodiment of the disclosure, the target sensor may be a Hall sensor mounted on the terminal screen. The target sensor determines whether the corresponding generated voltage level has changed based on the magnetic field strength. For example, the voltage level was previously low and the changed voltage level is high, or the voltage level was previously high and the changed voltage level is low.
[0070] In step 102, if the level value changes, the screen state is switched.
[0071] In this embodiment of the disclosure, after determining that the level value generated by the target sensor has changed, the screen state can be switched to the corresponding target screen state according to the changed target level value.
[0072] In the above embodiments, a level-triggered method is adopted to switch the screen state after the level value of the target sensor changes. This avoids misjudgment caused by electromagnetic interference from the surrounding environment when the target sensor uses an edge-triggered method, thus improving the accuracy of screen state switching and increasing its usability.
[0073] In an alternative embodiment, such as Figure 3 As shown, Figure 3 In the aforementioned Figure 2Based on the illustrated embodiment, another screen state switching method is shown, which may further include:
[0074] In step 103, multiple newly generated level values of the target sensor are continuously determined.
[0075] In this embodiment of the disclosure, the number of multiple level values can be a preset number. For example, the preset number is 5. After the terminal determines that the level value has changed, it can determine 5 new level values generated by the target sensor 5 times consecutively.
[0076] In step 104, based on the target level value changed by the target sensor and the plurality of level values, it is determined whether the screen state needs to be switched.
[0077] In this embodiment of the disclosure, if multiple consecutively determined level values are the same and all are the target level value, it is determined that the screen state needs to be switched; otherwise, it is determined that the screen state does not need to be switched. The target level value is the level value after the target sensor has changed.
[0078] After determining that the screen state needs to be switched, step 102 is executed to switch the screen state.
[0079] In the above embodiments, after the level value of the target sensor changes, multiple newly generated level values of the target sensor can be continuously determined. If the multiple level values are the same and the same as the target level value, it is determined that the screen state needs to be switched; otherwise, it is determined that the screen state does not need to be switched. This further reduces the possibility of false judgments from the target sensor, improves the accuracy of screen state switching, and has high usability.
[0080] In an alternative embodiment, such as Figure 4 As shown, Figure 4 In the aforementioned Figure 2 Based on the illustrated embodiment, another screen state switching method is shown, which may further include:
[0081] In step 105, the target event corresponding to the target level value after the target sensor changes is determined according to the preset correspondence between the level value and the event.
[0082] In this embodiment of the disclosure, the target level value is the level value changed by the target sensor, and the target event may include the target object moving away from the screen or the target object moving closer to the screen. Here, the target object may refer to the protective cover of the terminal.
[0083] Optionally, after the target sensor's voltage level changes to the target voltage level, the corresponding target event can be determined based on a preset correspondence between voltage level and events. Alternatively, after the target sensor's voltage level changes to the target voltage level, multiple newly generated voltage levels from the target sensor can be determined consecutively. If multiple voltage levels are identical to the target voltage level, the target event corresponding to the target voltage level can be determined based on the preset correspondence between voltage level and events.
[0084] For example, when the target level is high, the corresponding target event is that the target object is approaching the screen; when the target level is low, the corresponding target event is that the target object is moving away from the screen.
[0085] In step 106, the target event is reported through the target sensor.
[0086] The target sensor can report identified target events to the terminal's central processing unit.
[0087] Accordingly, step 102 may include:
[0088] In step 102-1, based on the preset correspondence between events and screen states, the screen state corresponding to the reported target event is taken as the target screen state.
[0089] For example, if the target event is that the target object approaches the screen, the target screen state is off. If the target event is that the target object moves away from the screen, the target screen state is on.
[0090] In step 102-2, the screen state is switched to the target screen state.
[0091] In this embodiment of the disclosure, the terminal's central processing unit can directly switch the screen state to the target screen state.
[0092] In the above embodiments, the target event corresponding to the target level value can be determined based on the correspondence between the level value and the event, and the target sensor reports the target event. Subsequently, based on the correspondence between the event and the screen state, the screen state is switched to the target screen state corresponding to the reported target event, which is simple to implement and highly usable.
[0093] Corresponding to the foregoing method embodiments, this disclosure also provides embodiments of the apparatus.
[0094] like Figure 5 As shown, Figure 5 This disclosure is a block diagram of a screen state switching device according to an exemplary embodiment, the device comprising:
[0095] The first determining module 210 is configured to determine whether the voltage level generated by the target sensor has changed;
[0096] The screen state switching module 220 is configured to switch the screen state if the level value changes.
[0097] like Figure 6 As shown, Figure 6 This disclosure illustrates a block diagram of another screen state switching device according to an exemplary embodiment, which is based on the foregoing Figure 5 Based on the embodiments, the device further includes:
[0098] The second determining module 230 is configured to continuously determine multiple newly generated level values of the target sensor;
[0099] The third determining module 240 is configured to determine whether the screen state needs to be switched based on the target level value changed by the target sensor and the plurality of level values.
[0100] The control module 250 is configured to control the screen state switching module 220 to switch the screen state after the third determining module 240 determines that the screen state needs to be switched.
[0101] like Figure 7 As shown, Figure 7 This disclosure illustrates a block diagram of another screen state switching device according to an exemplary embodiment, which is based on the foregoing Figure 6 Based on the embodiments, the third determining module 240 includes:
[0102] The first determining submodule 241 is configured to determine that the screen state needs to be switched if the plurality of level values are the same and are the same as the target level value; otherwise, it is determined that the screen state does not need to be switched.
[0103] like Figure 8 As shown, Figure 8 This disclosure illustrates a block diagram of another screen state switching device according to an exemplary embodiment, which is based on the foregoing Figure 5 Based on the embodiments, the device further includes:
[0104] The event determination module 260 is configured to determine the target event corresponding to the target level value changed by the target sensor based on a preset correspondence between level values and events;
[0105] Event reporting module 270 is configured to report the target event via the target sensor;
[0106] The screen state switching module 220 includes:
[0107] The second determining submodule 221 is configured to take the screen state corresponding to the reported target event as the target screen state according to the preset correspondence between events and screen states.
[0108] The switching submodule 222 is configured to switch the screen state to the target screen state.
[0109] Optionally, the target event includes the target object moving away from the screen or the target object moving closer to the screen.
[0110] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this disclosure according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0111] Accordingly, this disclosure also provides a computer-readable storage medium storing a computer program for executing any of the screen state switching methods described above.
[0112] Accordingly, this disclosure also provides a screen state switching device, the device comprising:
[0113] processor;
[0114] Memory used to store processor-executable instructions;
[0115] The processor is configured as follows:
[0116] Determine whether the voltage level generated by the target sensor has changed;
[0117] If the level value changes, the screen state is switched.
[0118] Figure 9 This is a block diagram illustrating an electronic device 900 according to an exemplary embodiment. For example, the electronic device 900 may be a mobile phone, tablet computer, e-book reader, multimedia playback device, wearable device, vehicle terminal, or other terminal.
[0119] Reference Figure 9The electronic device 900 may include one or more of the following components: processing component 902, memory 904, power supply component 906, multimedia component 908, audio component 910, input / output (I / O) interface 912, sensor component 916, and communication component 918.
[0120] Processing component 902 typically controls the overall operation of electronic device 900, such as operations associated with display, telephone calls, data communication, camera operation, and recording operations. Processing component 902 may include one or more processors 920 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 902 may include one or more modules to facilitate interaction between processing component 902 and other components. For example, processing component 902 may include a multimedia module to facilitate interaction between multimedia component 908 and processing component 902. As another example, processing component 902 may read executable instructions from memory to implement the steps of a screen state switching method provided in the above embodiments.
[0121] Memory 904 is configured to store various types of data to support the operation of electronic device 900. Examples of this data include instructions for any application or method operating on electronic device 900, contact data, phonebook data, messages, pictures, videos, etc. Memory 904 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 storage, flash memory, magnetic disk, or optical disk.
[0122] Power supply component 906 provides power to various components of electronic device 900. Power supply component 906 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 900.
[0123] The multimedia component 908 includes a display screen that provides an output interface between the electronic device 900 and the user. In some embodiments, the multimedia component 908 includes a front-facing camera and / or a rear-facing camera. When the electronic device 900 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera can receive external multimedia data. Each front-facing camera and rear-facing camera can be a fixed optical lens system or have focal length and optical zoom capabilities.
[0124] Audio component 910 is configured to output and / or input audio signals. For example, audio component 910 includes a microphone (MIC) configured to receive external audio signals when electronic device 900 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 904 or transmitted via communication component 918. In some embodiments, audio component 910 also includes a speaker for outputting audio signals.
[0125] I / O interface 912 provides an interface between processing component 902 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0126] Sensor assembly 916 includes one or more sensors for providing state assessments of various aspects of electronic device 900. For example, sensor assembly 916 can detect the on / off state of electronic device 900, the relative positioning of components such as the display and keypad of electronic device 900, changes in position of electronic device 900 or a component of electronic device 900, the presence or absence of user contact with electronic device 900, orientation or acceleration / deceleration of electronic device 900, and temperature changes of electronic device 900. Sensor assembly 916 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 916 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 916 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.
[0127] Communication component 918 is configured to facilitate wired or wireless communication between electronic device 900 and other devices. Electronic device 900 can access wireless networks based on communication standards, such as Wi-Fi, 2G, 3G, 4G, or 5G, or combinations thereof. In one exemplary embodiment, communication component 918 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 918 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0128] In an exemplary embodiment, the electronic device 900 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 methods described above.
[0129] In an exemplary embodiment, a non-transitory machine-readable storage medium including instructions is also provided, such as a memory 904 including instructions, which can be executed by a processor 920 of an electronic device 900 to complete the wireless charging method described above. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0130] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.
[0131] The above description is merely a preferred embodiment of this disclosure and is not intended to limit this disclosure. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A screen state switching method, characterized by, The method includes: Determine whether the voltage level generated by the target sensor has changed; If the level value changes, the screen state is switched; After the level value changes, the method further includes: Continuously determine multiple newly generated voltage values from the target sensor; Based on the target level value changed by the target sensor and the multiple level values, determine whether it is necessary to switch the screen state; After determining that the screen state needs to be switched, the step of switching the screen state is performed; The step of determining whether to switch the screen state based on the target level value changed by the target sensor and the plurality of level values includes: If the multiple level values are the same and the same as the target level value, then it is determined that the screen state needs to be switched. When the multiple level values are the same and are the same as the target level value, a target event corresponding to the target level value after the target sensor changes is determined according to the preset correspondence between level values and events. The target event includes the target object moving away from the screen or the target object moving closer to the screen. The target sensor reports the target event to the central processing unit. The switching of the screen state includes: Based on the preset correspondence between events and screen states, the screen state corresponding to the reported target event is taken as the target screen state. The central processing unit switches the screen state to the target screen state.
2. The method of claim 1, wherein, The step of determining whether to switch the screen state based on the target level value changed by the target sensor and the plurality of level values includes: If the multiple level values are not the same and do not match the target level value, it is determined that there is no need to switch the screen state.
3. A screen state switching apparatus, characterized by comprising: The device includes: The first determining module is configured to determine whether the voltage level generated by the target sensor has changed. The screen state switching module is configured to switch the screen state if the level value changes; The second determining module is configured to continuously determine multiple newly generated level values from the target sensor; The third determining module is configured to determine whether the screen state needs to be switched based on the target level value changed by the target sensor and the plurality of level values. The control module is configured to control the screen state switching module to switch the screen state after the third determining module determines that the screen state needs to be switched. The event determination module is configured to, when the multiple level values are the same and are the same as the target level value, determine the target event corresponding to the target level value after the target sensor has changed, according to a preset correspondence between level values and events. The target event includes the target object moving away from the screen or the target object moving closer to the screen. An event reporting module is configured to report the target event to the central processing unit via the target sensor; The screen state switching module includes: The second determining submodule is configured to take the screen state corresponding to the reported target event as the target screen state based on the preset correspondence between events and screen states. The switching submodule is configured to have the central processing unit switch the screen state to the target screen state. The third determining module includes: The first determining submodule is configured to determine that the screen state needs to be switched if the plurality of level values are the same and are the same as the target level value.
4. The apparatus of claim 3, wherein, The first determining submodule is configured to determine that if the multiple level values are the same and are the same as the target level value, it is not necessary to switch the screen state.
5. A computer readable storage medium, characterized in that, The storage medium stores a computer program, which is used to execute the screen state switching method according to any one of claims 1-2.
6. A screen state switching apparatus characterized by comprising: The device includes: processor; Memory used to store processor-executable instructions; The processor is configured as follows: Determine whether the voltage level generated by the target sensor has changed; If the level value changes, multiple newly generated level values of the target sensor are continuously determined; Based on the target level value changed by the target sensor and the multiple level values, determine whether it is necessary to switch the screen state; After determining that the screen state needs to be switched, the screen state is switched. The step of determining whether to switch the screen state based on the target level value changed by the target sensor and the plurality of level values includes: If the multiple level values are the same and the same as the target level value, then it is determined that the screen state needs to be switched. When the multiple level values are the same and are the same as the target level value, a target event corresponding to the target level value after the target sensor changes is determined according to the preset correspondence between level values and events. The target event includes the target object moving away from the screen or the target object moving closer to the screen. The target sensor reports the target event to the central processing unit. The switching of the screen state includes: Based on the preset correspondence between events and screen states, the screen state corresponding to the reported target event is taken as the target screen state. The central processing unit switches the screen state to the target screen state.