CN115632646A - Switch assembly, electronic device and switch state detection method - Google Patents
Switch assembly, electronic device and switch state detection method Download PDFInfo
- Publication number
- CN115632646A CN115632646A CN202211176788.2A CN202211176788A CN115632646A CN 115632646 A CN115632646 A CN 115632646A CN 202211176788 A CN202211176788 A CN 202211176788A CN 115632646 A CN115632646 A CN 115632646A
- Authority
- CN
- China
- Prior art keywords
- switch
- state
- light
- module
- cavity
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03K—PULSE TECHNIQUE
- H03K17/00—Electronic switching or gating, i.e. not by contact-making and –breaking
- H03K17/94—Electronic switching or gating, i.e. not by contact-making and –breaking characterised by the way in which the control signals are generated
- H03K17/941—Electronic switching or gating, i.e. not by contact-making and –breaking characterised by the way in which the control signals are generated using an optical detector
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01R—MEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
- G01R31/00—Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
- G01R31/327—Testing of circuit interrupters, switches or circuit-breakers
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Electronic Switches (AREA)
Abstract
The application discloses a switch assembly, electronic equipment and a switch state detection method, which comprises a main control module, a transmitting module, a receiving module and a switch unit, wherein the main control module is respectively connected with the transmitting module and the receiving module; the emitting module corresponds to the detection area and is used for emitting optical signals to the detection area; the switch unit comprises at least two switch states and at least two reflecting surfaces, each switch state corresponds to one reflecting surface, the reflecting parameters of different reflecting surfaces are different, and the reflecting surfaces of the switch unit in the detection area are different in different switch states; the receiving module is used for receiving optical signals reflected by the reflecting surface in the detection area; the main control module is used for acquiring intensity parameters corresponding to the optical signals received by the receiving module and determining the current switch state of the switch unit based on the intensity parameters. The current switch state can be determined based on the intensity parameter corresponding to the received optical signal, and the accuracy of detecting the current switch state is improved.
Description
Technical Field
The present disclosure relates to the field of switch technologies, and more particularly, to a switch assembly, an electronic device, and a method for detecting a switch state.
Background
At present, with the development of electronic information technology, the integrated functions of electronic devices are more and more. Although the switch assembly may be controlled to be in different states. However, the existing method for detecting the state of the switch assembly is susceptible to interference and has low detection precision.
Disclosure of Invention
The application provides a switch assembly, an electronic device and a switch state detection method, so as to overcome the defects.
In a first aspect, an embodiment of the present application provides a switch assembly, which includes a main control module, a transmitting module, a receiving module, and a switch unit, where the main control module is connected to the transmitting module and the receiving module respectively; the emitting module corresponds to a detection area and is used for emitting optical signals to the detection area; the switch unit comprises at least two switch states and at least two reflecting surfaces, each switch state corresponds to one reflecting surface, the reflecting parameters of different reflecting surfaces are different, and the reflecting surfaces of the switch unit in different switch states in the detection area are different; the receiving module is used for receiving the optical signal reflected by a reflecting surface in the detection area; the main control module is used for acquiring intensity parameters corresponding to the optical signals received by the receiving module and determining the current switch state of the switch unit based on the intensity parameters.
In a second aspect, an embodiment of the present application further provides an electronic device, including: the switch assembly of the first aspect, the switch assembly is disposed in the middle frame.
In a third aspect, an embodiment of the present application further provides a method for detecting a switch state, which is applied to the switch assembly in the first aspect, and the method includes: controlling the transmitting module to transmit a first signal to the current reflecting surface of the switch unit at a first power value; acquiring a second power value of a second signal, wherein the second signal comprises the first signal which is received by the receiving module and reflected by the current reflecting surface; and determining the current switching state of the switching unit based on the second power value.
The application provides a switch module, electronic equipment and on-off state detection method, this switch module is including emission module, host system, receiving module and switch element, and emission module is to detection area transmission light signal, every in the switch element the on-off state corresponds a reflection of light face, and switch element is under the on-off state of difference, is located reflection of light face in the detection area is different, and wherein the reflection parameter that different reflection of light faces correspond is different, and receiving module is used for receiving reflection of light face in the detection area light signal, host system are used for acquireing the intensity parameter that the light signal that receiving module received corresponds, and are based on intensity parameter confirms the present on-off state of switch element. Because the reflective surfaces in the detection areas are different in different switch states of the switch assembly, and different reflective surfaces have different reflection parameters, when the switch unit is in different switch states, the reflective surfaces in the detection areas have different reflection parameters, so that optical signals reflected by the reflective surfaces in the detection areas received by the receiving module are different, and the intensity parameters corresponding to the optical signals received by the receiving module, which are acquired by the main control module, are changed, and therefore, the current switch state of the switch unit can be determined based on the intensity parameters. And because the optical signal is not easily interfered by factors such as a magnetic field, the current switching state of the switching unit is determined, and the accuracy is high.
Additional features and advantages of embodiments of the present application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of embodiments of the present application. The objectives and other advantages of the embodiments of the application may be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 shows a schematic diagram of a switch state detection principle;
fig. 2 is a schematic structural diagram illustrating a switch assembly provided in an embodiment of the present application;
fig. 3 shows a schematic structural diagram of a transmitting module and a receiving module provided in an embodiment of the present application;
fig. 4 is a schematic structural diagram illustrating a switch unit provided in an embodiment of the present application;
fig. 5 is a schematic structural diagram illustrating a further switch unit provided in an embodiment of the present application;
fig. 6 is a schematic structural diagram of a further switch unit provided in an embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure;
FIG. 8 illustrates a method flow diagram of a switch state detection method provided by embodiments of the present disclosure;
FIG. 9 is a graph illustrating the illuminance of incident optical radiation provided by embodiments of the present application;
FIG. 10 is a diagram illustrating one embodiment of step S140;
FIG. 11 is a block diagram illustrating a structure of a computer-readable storage medium provided by an embodiment of the present application;
fig. 12 shows a block diagram of a computer program product provided in an embodiment of the present application.
Detailed Description
In order to make the technical solutions of the present application better understood, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
At present, with the development of electronic information technology, the integrated functions of electronic devices are more and more. Although the switch assembly may be controlled to be in different states. However, the existing method for detecting the state of the switch assembly is susceptible to interference and has low detection precision. How to improve the accuracy of detecting the state of the switch component is an urgent problem to be solved.
At present, electronic devices can be generally configured with a switch assembly, and a user controls the switch assembly to be located at different positions, so as to control the electronic devices accordingly. For example, a mechanical sliding switch may be used in the electronic device at present, that is, the switch assembly is a mechanical sliding switch. The mechanical sliding switch can comprise a sliding contact and a plurality of fixed contacts, and when the sliding contact is in direct contact with one fixed contact, the corresponding level of the mechanical sliding switch at the moment can be directly read, so that the switch state of the current switch component can be obtained.
For another example, the electronic device may further be configured with a multi-stage sliding switch, such as a three-stage sliding switch, where the multi-stage sliding switch may correspond to multiple switch states, for example, the three-stage sliding switch may correspond to three switch states, and a user may control the sliding switch to be in different switch states. Referring to fig. 1, fig. 1 shows a schematic diagram of a three-stage slide switch for detecting a switch state, the three-stage slide switch 110 may be provided with a magnet 111, a circuit board 120 may be provided with a first hall sensor 121 and a second hall sensor 122, and the first hall sensor 121 and the second hall sensor 122 may respectively implement data interaction with an electronic device through the circuit board 120, for example, implement communication with a main control module of the electronic device. The three-stage sliding switch 110 can have three switch states, and when the three-stage sliding switch 110 is in different switch states, the three-stage sliding switch 110 is located at different positions, for example, the three-stage sliding switch can be located at a first position, a second position or a third position, where the different positions are obtained by sliding and adjusting the three-stage sliding switch 110 in the sliding direction. Further, since the magnet 111 is disposed on the three-stage slide switch 110, the position of the magnet 111 changes with the position of the three-stage slide switch 110. A magnetic field is generated around the magnet 111, and the first hall sensor 121 or the second hall sensor 122 can induce an electric signal based on the intensity of the magnetic field around. The magnetic field intensity of the magnetic field generated by the magnet 111 has an inverse relationship with the distance from the magnet 111, that is, the magnetic field intensity of the magnetic field generated by the magnet 111 decreases as the distance from the magnet 111 increases. Therefore, when the position of the magnet 111 is changed according to the position of the three-stage slide switch 110, the spatial distance between the magnet and the first hall sensor 121 and the spatial distance between the magnet and the second hall sensor 122 are changed. Therefore, the magnetic field strength of the magnetic field generated by the magnet 111 sensed at the first hall sensor 121 and the magnetic field strength of the magnetic field generated by the magnet 111 sensed at the second hall sensor 122 are changed. Furthermore, the electric signal induced by the first hall sensor 121 and the electric signal induced by the second hall sensor 122 change with the position of the magnet 111, so that the different positions of the slide switch 110 can be detected.
However, the inventors have found in their research that, in the mechanical slide switch, the sliding contact needs to be in direct contact with the fixed contact, and the mechanical slide switch is susceptible to dust, moisture, and the like, which may cause erroneous detection of the switch state of the mechanical slide switch. Furthermore, as the existing electronic devices are increasingly pursuing light and thin, the layout control of the internal devices is increasingly limited, and some electronic devices have higher requirements for the image function, a larger number of cameras and the like need to be arranged. And in the limited layout control, along with the increase of the number of the cameras and the increase of the volume of a single camera, the distance between the camera and the first Hall sensor and the distance between the camera and the second Hall sensor which are arranged on the circuit board are closer and closer. And because a plurality of magnets are generally integrated in the camera, when the distance between the camera and the first hall sensor or the second hall sensor is small, the magnetic field generated by the magnet in the camera interferes with the first hall sensor or the second hall sensor. Therefore, in the method for detecting the position of the three-section type slide switch by using the first hall sensor and the second hall sensor, the first hall sensor or the second hall sensor may be affected by a magnetic field generated by a magnet inside the camera, so that the accuracy of detecting the position of the three-section type slide switch may be reduced. Based on the above analysis, in the method of determining the position of the multi-stage sliding switch by detecting the position of the magnet using the hall sensor, since the hall sensor needs to detect the magnetic field strength, the hall sensor in the multi-stage sliding switch may be interfered by the magnetic field generated by the magnet inside the camera no matter how many stages of the multi-stage sliding switch are, and the accuracy of detecting the position of the multi-stage sliding switch may be reduced.
Therefore, in order to overcome the above-mentioned drawbacks, the present application provides a switch assembly, an electronic device, and a switch state detection method.
Specifically, referring to fig. 2, fig. 2 shows a switch assembly 200 provided in an embodiment of the present application, specifically, the switch assembly 200 shown in fig. 2 includes a main control module 240, a transmitting module 220, a receiving module 230, and a switch unit 210, where the main control module 240 is connected to the transmitting module 220 and the receiving module 230, respectively.
For some embodiments, the emitting module 220 corresponds to the detecting region 221, and the emitting module 220 may emit the optical signal to the detecting region 221. Specifically, the transmitting module 220 may transmit the optical signal to the detection area 221 based on the control of the main control module 240. It is easily understood that the optical signals can be generally divided into visible light signals and invisible light signals, wherein the visible light signals are optical signals with wavelengths in the range of 380nm to 780nm, the invisible light signals are optical signals with wavelengths less than 380nm or with wavelengths greater than 780nm, wherein the optical signals with wavelengths less than 380nm are Ultraviolet (UV) optical signals, and the optical signals with wavelengths greater than 780nm are Infrared (IR) optical signals. The energy and the wavelength of the optical signal have an inverse correlation relationship, that is, the longer the wavelength of the optical signal is, the lower the corresponding energy is, and the shorter the wavelength of the optical signal is, the higher the corresponding energy is. Therefore, for one embodiment provided herein, the transmitting module 220 may transmit the infrared IR signal, so that power consumption may be reduced. Further, the emitting module 220 may emit the optical signal at a specific frequency, that is, the control module may control the emitting module 220 to emit the optical signal at a specific time interval, where the specific frequency and the specific time interval are inverse relations to each other.
For some embodiments, the switch unit 210 may have different switch states, and the user may control the switch unit 210 to make the switch unit 210 in different switch states. For example, the switching unit 210 may have at least two switching states. Further, the current switch state of the switch unit 210 may be detected by the main control module 240. For other embodiments, after determining the current switching state of the switching unit 210, the main control module 240 may further control the electronic device to operate in a target operating state based on the current switching state, where the target operating state is determined based on the current switching state. For specific methods, reference may be made to the description of the following examples.
Further, each different switch state of the switch unit 210 may correspond to a reflective surface. Thus, for the above-described switching unit 210 to have at least two switching states, at least two light-reflecting surfaces should correspond to the at least two switching states. Wherein the light-reflecting surface may be used to reflect an incident optical signal. An optical signal incident on the light-reflecting surface may be referred to as an incident optical signal, and the incident optical signal is reflected by the light-reflecting surface to form a reflected optical signal. Wherein the intensity parameter of the reflected light signal is less than or equal to the intensity parameter of the incident light signal. The intensity parameter may be used to characterize the energy intensity of the optical signal, and may be, for example, a power value. It will be appreciated that the reflective surface has a reflection parameter, which is an intrinsic parameter used to characterize the degree to which the reflective surface reflects incident light signals. Under the condition that the incident light signal is not changed, the reflection parameter and the intensity parameter have positive correlation, namely the larger the reflection parameter is, the stronger the degree of reflecting the incident light signal by the reflecting surface is represented, and therefore the intensity parameter of the reflected light signal is larger; the smaller the reflection parameter, the weaker the degree to which the reflective surface is characterized as reflecting the incident optical signal, and thus the smaller the intensity parameter of the reflected optical signal. As an example, the reflection parameter may be a reflectivity, and the higher the reflectivity, the closer the power values of the reflected light signal and the incident light signal. Therefore, different switch states can be set, and the reflection parameters of the corresponding reflection surfaces are different, that is, the reflection light signals reflected by the reflection surfaces with different intensity parameters can be obtained by transmitting the light signals with the same intensity parameters to the reflection surfaces, so that the current switch state of the switch unit 210 can be determined. Specific methods can be referred to in the description of the following embodiments.
Further, as can be seen from the foregoing analysis, the emitting module 220 may emit a light signal to the detecting region 221, and in order to enable the light signal emitted by the emitting module 220 to the detecting region 221 to be incident to the light reflecting surface corresponding to the current switch state of the switch unit 210, when the switch unit 210 is in different switch states, the light reflecting surface located in the detecting region 221 is a light reflecting surface with different reflectivities, so that the light signal emitted by the emitting unit can be reflected by the light reflecting surfaces with different reflection parameters in different switch states. For example, the switch states of the switch unit 210 may include a first state, a second state and a third state, wherein the first state may correspond to the first light reflecting surface 211, the second state may correspond to the second light reflecting surface 212 and the third state may correspond to the third light reflecting surface 213. When the current switching state of the switching unit 210 is the first state, the reflective surface located in the detection area 221 is the first reflective surface 211, and at this time, the optical signal emitted by the emitting module 220 may be reflected by the first reflective surface 211; when the current switching state of the switching unit 210 is the second state, the reflective surface located in the detection area 221 is the second reflective surface 212, and at this time, the optical signal emitted by the emitting module 220 may be reflected by the second reflective surface 212; when the current switching state of the switching unit 210 is the third state, the light reflecting surface located in the detection area 221 is the third light reflecting surface 213, and at this time, the optical signal emitted by the emitting module 220 may be reflected by the third light reflecting surface 213.
For some embodiments, the receiving module 230 may be configured to receive an optical signal, and for embodiments provided herein, the receiving module 230 may be configured to receive the optical signal reflected by the light-reflecting surface in the detection region 221. It is understood that the main control module 240 generally cannot receive the optical signal directly, so that the received optical signal can be converted into an electrical signal by the receiving module 230, for example, the received optical signal is converted into the electrical signal by the optical-to-electrical converter, and then the electrical signal is sent to the main control module 240, and the main control module 240 performs data sorting and processing on the electrical signal, so as to determine an intensity parameter corresponding to the optical signal received by the receiving module 230, and then can determine the current on-off state of the switch unit 210 based on the intensity parameter.
It should be noted that, since the receiving module 230 needs to receive the optical signal and is related to the optical signal emitted by the emitting module 220, the wavelength of the optical signal that can be received by the receiving module 230 should match the wavelength of the optical signal emitted by the emitting module 220. As can be understood from the foregoing description, the optical signal emitted by the emitting module 220 may be an infrared IR signal, and therefore the receiving module 230 should be a module capable of receiving the infrared IR signal. For example, the transmitting module 220 may be an infrared IR transmitting diode, and the receiving module 230 may be an infrared IR receiving diode.
Further, the transmitting module 220 and the receiving module 230 may be two separate modules, such as the infrared IR emitting diode and the infrared IR receiving diode described above. It may also be two modules in one entity, for example, an infrared IR emitting diode and an infrared IR receiving diode may both be included in the infrared light sensor.
Optionally, the transmitting module 220 may further include a plurality of infrared IR transmitting diodes, and the receiving module 230 may further include a plurality of infrared IR receiving diodes, so that the reliability of the operations of the transmitting module 220 and the receiving module 230 may be improved.
Referring to fig. 3, fig. 3 is a schematic structural diagram of a transmitting module and a receiving module. Specifically, the anode of the IR emitting diode 220 is connected to the power source terminal 224, the cathode thereof is connected to the ground terminal 225, the driving circuit 222 is respectively connected to the register 223 and the cathode of the IR emitting diode 220, the register 223 is further connected to the power source terminal 224 and the analog-to-digital conversion module 228, and the analog-to-digital conversion module 228 is further connected to the IR receiving diode 230, the crystal oscillator 227, the power source terminal 224 and the reference voltage 226. Wherein, the emission parameters of the IR emitting diode 220, such as the emission power, the emission frequency, etc., can be set through the register 223, and specifically, the register 223 controls the IR emitting diode 220 through the driving circuit 222. Further, the crystal 227 provides a clock signal to the analog-to-digital conversion module 228, and the reference voltage 226 provides a reference voltage value to the analog-to-digital conversion module 228. The infrared IR receiving diode 230 receives the optical signal and sends the optical signal to the analog-to-digital conversion module 228.
It should be noted that the transmitting module 220 and the receiving module 230 are only an example, and other components may also be used to drive the transmitting module 220 to transmit the optical signal and the receiving module 230 to receive the optical signal.
Further, the main control module 240 may be configured to control the transmitting module 220 to transmit the optical signal, for example, may control the transmitting module 220 to transmit the optical signal every a specified time interval. The main control module 240 may be further configured to process the optical signal received by the receiving module 230 and reflected by the reflective surface in the detection area 221, so as to obtain an intensity parameter of the optical signal reflected by the reflective surface in the detection area 221. For example, the main control module 240 may process the acquired signal received by the receiving module 230, so as to obtain a power value of the signal received by the receiving module 230. Further, the main control module 240 may determine the current state of the control switch according to the power parameter. For a specific method for acquiring the state of the control switch, reference may be made to the following embodiments.
The main control module 240 may be implemented in at least one hardware form of a Digital Signal Processing (DSP), a Field-Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), and a Micro Control Unit (MCU).
Referring to fig. 4, fig. 4 illustrates a switch unit 210 according to an embodiment of the present disclosure, and in particular, the switch unit 210 illustrated in fig. 4 includes a sliding component 218 and a light reflecting component 219.
For some embodiments, the light reflecting component 219 may be disposed on the sliding component 218, and the light reflecting component 219 may move along with the movement of the sliding component 218, i.e., the sliding component 218 may move the light reflecting component 219. As can be seen from the foregoing embodiments, the switch unit 210 may include at least two switch states, and a user may control the switch unit 210 to make the switch unit 210 in different switch states. Specifically, referring to fig. 4, the sliding assembly 218 is provided with a sliding block 217, and a user can slide the switch unit 210 by sliding the sliding block, so as to enable the switch unit 210 to be in different switch states.
Further, since the user slides the switch unit 210 to make the switch unit 210 in different switch states, for the switch unit 210 with at least two switch states, the sliding component 218 corresponds to at least two stroke positions, each stroke position corresponds to one switch state, and the number of stroke positions should be greater than or equal to the number of switch states. For example, if the switch states are three, the number of travel positions corresponding to the sliding member 218 is at least three.
Further, the light reflecting component 219 may include a plurality of light reflecting surfaces. As can be understood from the foregoing description of the embodiments, the switch states of the switch units 210 correspond to the light-reflecting surfaces, and therefore, the number of the light-reflecting surfaces included in the light-reflecting assembly 219 should be the same as the number of the switch states of the switch units 210. For example, if the number of the switch units 210 is three, three light reflecting surfaces are included in the light reflecting member 219. Referring to fig. 4, the light-reflecting component 219 includes a first light-reflecting surface 211, a second light-reflecting surface 212, and a third light-reflecting surface 213.
As can be seen from the foregoing embodiments, in order to reflect the light signal emitted from the emitting unit through the light-reflecting surfaces with different reflection parameters in different switch states, it is necessary that the different light-reflecting surfaces of the light-reflecting component 219 are located in the detection area 221 when the sliding component 218 is in different stroke positions, i.e. when the switch unit 210 is in different switch states. Referring to fig. 4, 5 and 6, the switch unit 210 shown in fig. 4, 5 and 6 includes three switch states, specifically, a first state, a second state and a third state. The first state may correspond to the first light reflecting surface 211, the second state may correspond to the second light reflecting surface 212, and the third light reflecting surface 213 may correspond to the third light reflecting surface 213. Therefore, the corresponding travel positions of the sliding member 218 may be the first position, the second position, and the third position. For an exemplary purpose, referring to fig. 4, when the sliding element 218 is in the first position, the switch unit 210 may be in the first state, where the first light-reflecting surface 211 corresponding to the first state is located in the detection area 221. Referring to fig. 5, when the sliding element 218 is in the second position, the switch unit 210 can be in the second state, and the second reflective surface 212 corresponding to the second state is located in the detection area 221. Referring to fig. 6, when the sliding element 218 is in the third position, the switch unit 210 can be in the third state, and the third light-reflecting surface 213 corresponding to the third state is located in the detection area 221.
For some embodiments, the reflective parameters of the first light reflecting surface 211, the reflective parameters of the second light reflecting surface 212, and the reflective parameters of the third light reflecting surface 213 are different. For example, the reflection parameter of the first light reflecting surface 211, the reflection parameter of the second light reflecting surface 212, and the reflection parameter of the third light reflecting surface 213 may be sequentially increased, and when the reflection parameter is the reflectivity, the reflectivity of the first light reflecting surface 211, the reflectivity of the second light reflecting surface 212, and the reflectivity of the third light reflecting surface 213 may be sequentially increased.
In other embodiments, the reflection parameter of the first light reflecting surface 211, the reflection parameter of the second light reflecting surface 212, and the reflection parameter of the third light reflecting surface 213 may be sequentially decreased, or may have other relationships.
Alternatively, the reflective surfaces may have different reflectivities due to different colors. Therefore, the first light reflecting surface 211, the second light reflecting surface 212 and the third light reflecting surface 213 can achieve different reflectivities by setting different colors of light reflecting surfaces. The black reflective surface has a smaller reflectivity, the white reflective surface has a larger reflectivity, and the reflectivity of the gray reflective surface is generally between the reflectivity of the white reflective surface and the reflectivity of the black reflective surface. For example, the first light reflecting surface 211 may be a black light reflecting surface, the second light reflecting surface 212 may be a gray light reflecting surface, and the third light reflecting surface 213 may be a white light reflecting surface.
Alternatively, different reflectivities may be provided due to the different shapes of the reflective surfaces. The first light reflecting surface 211, the second light reflecting surface 212 and the third light reflecting surface 213 may have different shapes, such as convex, concave or planar. For example, the first light reflecting surface 211 may be concave, the second light reflecting surface 212 may be convex, and the third light reflecting surface 213 may be flat.
Alternatively, the first light reflecting surface 211, the second light reflecting surface 212, and the third light reflecting surface 213 may be made of the same material, and the same material may be a material having a higher transmittance and a lower reflectance. Each of the light-reflecting surfaces is then coated, for example, with a reflective coating, to increase the reflectivity of each light-reflecting surface. Specifically, the reflectivity of different reflective surfaces can be adjusted by adjusting the reflectivity of the reflective film, so that the reflective surfaces corresponding to different switch states have different reflectivities. For example, if the reflectivity of the reflective surface without coating is 10%, the reflective surface 211 may be coated with a reflective film with a lower reflectivity, so that the reflectivity of the reflective surface 211 is improved less, for example, the reflectivity of the reflective surface 211 after coating with the reflective film is 20%; a reflective film with a higher reflectivity may be plated on the second reflective surface 212, so that the reflectivity of the second reflective surface 212 is improved to be higher, for example, the reflectivity of the second reflective surface 212 after the reflective film is plated is 40%; the third light reflecting surface 213 may be coated with a reflective film with a high reflectivity, so as to improve the reflectivity of the third light reflecting surface 213 to a high degree, for example, the reflectivity of the third light reflecting surface 213 after being coated with the reflective film is 60%.
Optionally, since the transmittance and the reflectance have an inverse correlation with each other for the same reflective surface, an antireflection film may be further coated on the material with higher reflectance, so that the transmittance is improved, and the reflectance is reduced. Therefore, in the above example, the same material for the first light reflecting surface 211, the second light reflecting surface 212, and the third light reflecting surface 213 may be a material having a low transmittance and a high reflectance. Each of the light-reflecting surfaces is then coated, for example with an antireflective coating, to reduce the reflectivity of each light-reflecting surface. Specifically, the reflectivity of different reflecting surfaces can be adjusted by adjusting the anti-reflection rate of the anti-reflection film, so that the reflecting surfaces corresponding to different switch states have different reflectivities. For example, if the reflectivity of the uncoated reflective surface is 90%, the first reflective surface 211 may be coated with an anti-reflection film with a higher transmittance, so as to increase the transmittance of the first reflective surface 211 more and reduce the reflectivity of the first reflective surface 211 more, for example, the reflectivity of the anti-reflection film coated first reflective surface 211 is 20%; the second light reflecting surface 212 may be coated with an anti-reflective coating having a generally high transmittance, such that the transmittance of the second light reflecting surface is generally increased, and the reflectance of the second light reflecting surface 212 is generally decreased, for example, the reflectance of the second light reflecting surface 212 coated with the anti-reflective coating is 40%; the third light reflecting surface 213 may be coated with an anti-reflective coating having a lower transmission such that the transmission of the first light reflecting surface increases less and the reflection of the second light reflecting surface 212 decreases less, for example, the reflection of the second light reflecting surface 212 after being coated with an anti-reflective coating is 60%.
Optionally, the first light reflecting surface 211, the second light reflecting surface 212, and the third light reflecting surface 213 may also be made of different materials, and the light reflecting surfaces made of different materials may have different reflectivities. For example, the first light reflecting surface 211 may be made of a first material and have a low reflectivity, such as 20%; the second reflective surface 212 may be formed of a second material having a general reflectivity, such as 40%; the third reflective surface 213 may be made of a third material and has a high reflectivity, such as 60%.
The application provides a switch module, this switch module is including emission module, host system, receiving module and switch element, and emission module is to detection area transmitting optical signal, every in the switch element the on-off state corresponds a reflection of light face, and switch element is under the on-off state of difference, is located reflection of light face in the detection area is different, and wherein the reflection parameter that different reflection of light faces correspond is different, and receiving module is used for receiving reflection of light face in the detection area light signal, host system are used for acquireing the intensity parameter that the receiving module received the optical signal and correspond, and based on intensity parameter confirms the present on-off state of switch element. Because the light reflecting surfaces in the detection areas are different in different switch states of the switch assembly, and the different light reflecting surfaces have different reflection parameters, when the switch unit is in different switch states, the light reflecting surfaces in the detection areas have different reflection parameters, so that the light signals reflected by the light reflecting surfaces in the detection areas received by the receiving module are also different, the intensity parameters corresponding to the light signals received by the receiving module, which are acquired by the main control module, are changed, and the current switch state of the switch unit can be determined based on the intensity parameters. And because the optical signal is not easily interfered by factors such as a magnetic field, the current switching state of the switching unit is determined with high accuracy.
Referring to fig. 7, fig. 7 is a block diagram illustrating an electronic device 300 according to an embodiment of the disclosure. The electronic device 300 includes a middle frame 310 and a switch assembly 200.
Specifically, the switch assembly 200 may include a main control module 240, a transmitting module 220, a receiving module 230, and a switch unit 210. The switch unit 210 may include a sliding member 218 and a light reflecting member 219, wherein the sliding member 218 is connected to the light reflecting member 219. Thus, the light reflecting member 219 may move following the movement of the sliding member 218, and the sliding member 218 may be used to move the light reflecting member 219. Further, the sliding assembly 218 may be provided with a slider 217, and the sliding assembly 218 may be exposed on the surface of the middle frame 310, and for some embodiments, the slider 217 provided on the sliding assembly 218 may be exposed on the surface of the middle frame 310, so that a user may conveniently move the sliding assembly 218 by sliding the slider 217, so as to enable the switch unit to be in different switch states, and simultaneously drive the light reflecting assembly 219 to move.
For one embodiment provided herein, the sliding assembly 218 may have three corresponding travel positions, and the light reflecting assembly 219 may include three light reflecting surfaces, a first light reflecting surface 211, a second light reflecting surface 212, and a third light reflecting surface 213. Each stroke position corresponds to a switch state of the switch unit 210, and thus each switch state corresponds to a light-reflecting surface. When the switch unit 210 is in different switch states, the light-reflecting surface located in the detection region 221 is different. Since different light-reflecting surfaces have different reflection parameters, the light signals reflected by the light-reflecting surfaces in the detection area 221 received by the receiving module 230 are also different, so that the intensity parameter corresponding to the light signal received by the receiving module 230, which is acquired by the main control module 240, is changed, and thus the current switching state of the switching unit 210 can be determined based on the intensity parameter.
The specific functions of the main control module 240, the transmitting module 220, the receiving module 230, and the switch unit 210 may refer to the descriptions in the foregoing embodiments, and are not described herein again.
With continued reference to fig. 7, the middle frame 310 may form a cavity 311, and the transmitting module 220, the receiving module 230, and the light reflecting member 219 may be mounted in the cavity 311. Specifically, cavity 311 may include a first cavity 3111 and a second cavity 3112, wherein light reflecting component 219 may be located in first cavity 3111, and transmitting module 220 and receiving module 230 may be located in second cavity 3112. Further, since the transmitting module 220 may transmit an optical signal, specifically, the optical signal may be transmitted from the light reflecting component 219, the optical signal transmitted by the transmitting module 220 needs to be transmitted from the second cavity 3112 to the first cavity 3111. Thus, between the second cavity 3112 and the first cavity 3111, there may also be a light channel 3113, wherein the light channel 3113 may be used for transmitting light signals. Further, the optical signal emitted from the emitting module 220 located in the second cavity 3112 may enter the first cavity 3111 through the optical channel 3113, specifically may be incident to the light reflecting component 219 located in the first cavity 3111, and after being reflected by the light reflecting component 219, enter the second cavity 3112 through the optical channel 3113, and be received by the receiving module 230 located in the second cavity 3112.
Optionally, a plate 320 is further disposed between the first cavity 3111 and the second cavity 3112, wherein the plate 320 may be disposed on the middle frame 310, the plate 320 is provided with a through hole 321, and two sides of the through hole 321 are respectively connected to the first cavity 3111 and the second cavity 3112, so for some embodiments, the through hole 321 may serve as a light channel 3113 for transmitting a light signal between the first cavity 3111 and the second cavity 3112. The through hole 321 extends vertically to the area of the reflective component 219 to serve as the detection area 221. Therefore, the optical signal emitted from the emitting module 220 to the detecting region 221 can be incident on the light reflecting surface in the detecting region 221. Fig. 7 shows an exemplary electronic device 300 in which the light-reflecting surface located in the detection area 221 is the second light-reflecting surface 212. Therefore, at this time, the optical signal emitted by the emitting module 220 to the detecting region 221 may be incident on the second light reflecting surface 212 in the detecting region 221, and then reflected by the second light reflecting surface 212, and then received by the receiving module 230.
Optionally, with continued reference to fig. 7, in the electronic device 300 shown in fig. 7, a circuit board 3114 may be further disposed in the second cavity 3112, wherein the transmitting module 220 and the receiving module 230 are both mounted on the circuit board 3114. For some embodiments, the main control module 240 may also be mounted on the circuit board 3114, so that the connection between the main control module 240 and the transmitting module 220 and the receiving module 230 may be achieved through the circuit board 3114. For example, the Circuit board 3114 may be a Flexible Printed Circuit (FPC).
Optionally, in order to enable the transmitting module 220 to transmit the optical signal to the detecting region 221 and enable the receiving module 230 to receive the optical signal reflected by the reflective surface located in the detecting region 221, a light guide pillar may be disposed between the transmitting module 220 and the receiving module 230 and the detecting region 221, so that the optical signal transmitted by the transmitting module 220 may be coupled into the detecting region 221 through the light guide pillar, and the optical signal reflected by the reflective surface of the detecting region 221 may be coupled into the receiving module 230 through the light guide pillar. Specifically, referring to fig. 7, in the electronic device 300 shown in fig. 7, the light guide bar 330 may be disposed on the end surface 321 of the plate 320 facing the second cavity 3112. The light guide bar 330 includes a first light transmission region 331 and a second light transmission region 332, wherein the first light transmission region 331 and the second light transmission region 332 can pass through the optical signal without causing attenuation of the power parameter to the optical signal. Further, the first light transmission region 331 and the second light transmission region 332 are disposed at an interval and are both located at the through hole 321, and a region of the light guide bar except the first light transmission region 331 and the second light transmission region 332 is a light shielding region, i.e., a region between the first light transmission region 331 and the second light transmission region 332 is also a light shielding region. Wherein the light-blocking area cannot pass an optical signal.
Therefore, the light signal emitted by the emitting module 220 can be sequentially emitted into the first cavity 3111 through the first light-transmitting area 331 and the light channel 3113, and the light signal reflected by the light-reflecting component 219 in the first cavity 3111, that is, the light signal reflected by the light-reflecting surface of the light-reflecting component 219 located in the detection area 221, is received by the receiving module 330 through the light channel 3113 and the second light-transmitting area 332.
Further, in order to prevent moisture or dust in the air from entering the switch assembly 200 through the middle frame 310, so as to affect transmission and detection of the optical signal and further affect the accuracy of detection of the switch state of the switch unit, please refer to fig. 7, a waterproof adhesive 340 may be filled between the end surface 321 of the plate 320 facing the second cavity 3112 and the light guide column 330.
Further, in order to allow the optical signal emitted from the emitting module 220 to be reflected by the light reflecting member 219 and then received by the receiving module 230, rather than coupling a portion of the optical signal directly into the receiving module 230 when the emitting module 220 emits the optical signal, an optical isolation module 350 may be disposed between the emitting module 220 and the receiving module 230 in the second cavity 3112. The optical isolation module 350 may be configured to prevent the receiving module 230 from directly coupling the optical signal transmitted by the transmitting module 220, so as to improve the accuracy of determining the current switching state of the switching unit based on the optical signal received by the receiving module and reflected by the reflective surface in the detection region 221.
Referring to fig. 8, fig. 8 is a flowchart illustrating a method for detecting a switch state according to the present application, where the method for detecting a switch state can be applied to a main control module in a switch assembly in the foregoing embodiments, where the switch assembly further includes a transmitting module, a receiving module, and a switch unit, and the main control module is connected to the transmitting module and the receiving module respectively. Specifically, the switch state detection method includes steps S110 to S140.
Step S110: and controlling the transmitting module to transmit a first signal to the current light reflecting surface of the switch unit at a first power value.
For some embodiments, after the electronic device is powered on to operate, the main control module controls the transmitting module to transmit the first signal. As can be seen from the foregoing description, the first signal may be an optical signal, such as an infrared IR optical signal. Specifically, the control module may automatically control the transmitting module to transmit the first signal after the electronic device is powered on to operate. For example, the control module may control the transmitting module to transmit the optical signal at a specific frequency, where the specific frequency may be flexibly set according to needs, and the embodiments of the present application are not limited thereto.
Further, the optical signal emitted by the emitting module is incident to the current light reflecting surface, where the current light reflecting surface is the light reflecting surface corresponding to the current switch state of the switch unit. The switch unit includes at least two switch states, each switch state corresponds to a reflective surface, and each reflective surface has different reflective parameters. The first signals reflected by the light-reflecting surfaces having different reflectivities are different for the same first signal, and thus the current switching state of the switching unit can be determined based on the first signal reflected by the current light-reflecting surface.
Specifically, each time the first signal is transmitted, the first signal may be transmitted at a first power value, so that a power value of the first signal reflected by the current light reflecting surface may be measured, and then the current light reflecting surface may be determined based on a difference between the measured power value and the first power value, so that the current switch state of the switch unit may be determined based on the current light reflecting surface.
Step S120: and acquiring a second power value of a second signal, wherein the second signal comprises the first signal which is received by the receiving module and reflected by the current light reflecting surface.
After the transmitting module transmits the first signal, a second signal can be received by the receiving module, wherein the second signal is the first signal reflected by the current light reflecting surface, that is, the second signal is also an optical signal. Furthermore, as can be seen from the above analysis, in order to determine the current light reflecting surface, a second power value of the second signal needs to be obtained. For some embodiments, the second power value may be calculated by the optical power measurement module. For example, after acquiring the second signal, the receiving module may send the second signal to the optical power measurement module in the form of an optical signal, and the optical power measurement module may receive the second signal and calculate to obtain a second power value, and then send the second power value to the main control module in the form of an electrical signal. For other embodiments, after receiving the second signal, the receiving module may generate a third signal through the ADC module, where the third signal is used to represent the second signal in the form of an electrical signal, and then send the third signal to the main control module, and the main control module obtains a power value of the third signal through a preset algorithm based on the third signal, where the power value of the third signal is a second power value corresponding to the second signal. For example, referring to fig. 9, the main control module may generate the incident light radiation illuminance map shown in fig. 9 based on the third signal, wherein the x-axis in fig. 9 is used for characterizing that the receiving module is used for receiving the second signalThe range of the photosensitive element in the first direction of the signal, and the range of the photosensitive element in the second direction of the signal, which is used for receiving the second signal, is represented by the y-axis. When x is positive, it means that the photosensitive element is shifted by x in the first direction, and when x is negative, it means that the photosensitive element is shifted by x in the direction opposite to the first direction; when y is positive, it is expressed as a shift of the photosensitive element by y in the second direction, and when y is negative, it is expressed as a shift of the photosensitive element by y in the direction opposite to the second direction. For example, when the coordinate corresponding to the x-axis is 0 and the coordinate corresponding to the y-axis is 0, the corresponding point is the center point of the photosensitive element. Where the x-axis is in millimeters and the y-axis is in millimeters. In a graph determined by the x-axis and the y-axis, a plurality of points is also included, each point may have a color, such as red, green or blue. Different colors corresponding to different illumination intensities, wherein the illumination intensity may be in Watts per square meter (W/m) 2 ) The irradiance can be used to characterize the amount of power per unit area. For example, a change from red to blue may represent a change in irradiance from large to small, where red represents an irradiance of 1000W/m 2 And the radiation illuminance represented by blue may be 3.16228x10 -7 W/m2. Therefore, all points in the coordinates represented by the x-axis and the y-axis are the optical signals corresponding to the second signals received by the receiving module. Further, the main control module may calculate a second power value of the second signal based on each point in fig. 9. As can be seen from the foregoing description, the reflection parameter of the first light reflecting surface, the reflection parameter of the second light reflecting surface, and the reflection parameter of the third light reflecting surface may be sequentially increased, so that, in the embodiment shown in the present application, for a first signal with the same first power value, the second power of the second signal reflected by the first light reflecting surface should be minimum, the second power of the second signal reflected by the second light reflecting surface should be medium, and the second power of the second signal reflected by the third light reflecting surface should be maximum. For example, the second power reflected by the first reflective surface is 1.07nW, the second power reflected by the second reflective surface is 7.48nW, the second power reflected by the third reflective surface is 10.38nW,where nW is the unit of nanowatt of power.
Step S130: and determining the current switching state of the switching unit based on the second power value.
For some embodiments, after the second power value is obtained, a light reflecting surface that reflects the first signal at present may be determined based on a difference between the second power value and the first power value, and then the corresponding switch state may be determined according to the light reflecting surface. Specifically, the reflection parameter of the first light reflecting surface, the reflection parameter of the second light reflecting surface, and the reflection parameter of the third light reflecting surface may be predetermined, for example, 20%, 40%, and 60%, respectively, and the first light reflecting surface is determined to correspond to the first state, the second light reflecting surface is determined to correspond to the second state, and the third light reflecting surface is determined to correspond to the third state. Then, after the second power value is obtained, the ratio of the second power value to the first power value may be obtained, and when the ratio is 20%, it may be determined that the second signal is the first signal reflected by the first light-reflecting surface, so that it may be determined that the current switching state of the switching assembly is the first state. When the ratio is 40% or 60%, the determination method is similar, and will not be described here.
For other embodiments, at least two threshold ranges may be predetermined, each threshold range corresponding to a switch state, and the switch state of the current switch assembly may be determined based on the threshold range at which the second power value is located. It will be readily appreciated that the number of threshold ranges should correspond to the number of switch states. For example, in the embodiments provided herein, the switch states include three, and the threshold ranges should include three, such as the first threshold range, the second threshold range, and the third threshold range.
Specifically, the electronic device may be controlled to enter the setting mode in advance to set the threshold range. After entering the setting mode, the switch unit may be controlled to be in different switch states in sequence, and in each switch state, the transmitting module is controlled to transmit the first signal at the first power value, and then the second power values of the plurality of second signals are obtained. For an exemplary case, when the switch unit is in the first state, the first signal may be transmitted with the first power value, and at this time, the second power value of the second signal may be obtained. In this case, the specified deviation value may be set based on the current second power value, so that the second power value is deviated by the specified deviation range to be the first threshold range, for example, the specified deviation range is set to be 0.1nW, and then the first threshold range may be determined to be 0.9nW to 1.1nW. Similarly, the second threshold range and the third threshold range may be determined, which is not described herein again. After the first threshold range, the second threshold range, and the third threshold range are determined, the setup mode may be exited.
Further, if the currently acquired second power value is within the first threshold range, it may be determined that the current switching state of the switching unit is the first state; similarly, when the second power value is in the second threshold range, the current switching state of the switching unit may be determined to be the second state; and when the second power value is in a third threshold value range, determining that the current switching state of the switching unit is a third state.
Step S140: and controlling the electronic equipment to work in a target working state based on the current switching state of the switching unit.
Optionally, after determining the current switch state of the switch unit, for other embodiments, the electronic device may be further controlled to operate in the target operating state based on the current switch state. For example, the target operation state may be a maximum display brightness, a mute state, or the like. Specifically, referring to fig. 10, fig. 10 shows an implementation diagram of step S140, which includes step S141 to step S143.
Step S141: and if the current switching state of the switching unit is the first state, controlling the electronic equipment to work in the ringing state.
Step S142: and if the current switching state of the switching unit is the second state, controlling the electronic equipment to work in the vibration state.
Step S143: and if the current switching state of the switching unit is the third state, controlling the electronic equipment to work in the mute state.
For some embodiments, the target operating state may include a ring state, a vibration state or a mute state, and it may be preset to control the electronic device to operate in the ring state when the current switching state of the switching unit is the first state; when the current switching state of the switching unit is the second state, controlling the electronic equipment to work in the vibration state; and when the current switching state of the switching unit is the third state, controlling the electronic equipment to work in the mute state. Therefore, a user can control the switch assembly to enable the switch unit to be in different switch states, so that the electronic equipment can be rapidly controlled to work in a target working state.
It is easy to understand that the target operating state may include other states, and the corresponding relationship between the target operating state and the switch state may be flexibly set as required.
The switch state detection method provided by the application can be applied to a main control module in a switch assembly in the previous embodiment, the switch assembly further comprises a transmitting module, a receiving module and a switch unit, and the transmitting module is controlled to transmit a first signal to a current light reflecting surface of the switch unit at a first power value; and finally, determining the current switching state of the switching unit based on the second power value. Because the reflecting surfaces in the detection areas are different in different switch states of the switch assembly, and different reflecting surfaces have different reflecting parameters, when the switch unit is in different switch states, the reflecting surfaces in the detection areas have different reflecting parameters, so that second signals reflected by the reflecting surfaces in the detection areas received by the receiving module are different, and a second power value acquired by the main control module is changed, and the current switch state of the switch unit can be determined based on the second power value. And because the optical signal is not easily interfered by factors such as a magnetic field, the switch state is determined by the second power value of the second signal, and the accuracy is higher.
Referring to fig. 11, a block diagram of a computer-readable storage medium according to an embodiment of the present application is shown. The computer-readable medium 1100 has stored therein program code that can be called by a processor to perform the method described in the above-described method embodiments.
The computer-readable storage medium 1100 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer-readable storage medium 1100 includes a non-volatile computer-readable medium. The computer readable storage medium 1100 has storage space for program code 1110 for performing any of the method steps of the method described above. The program code can be read from or written to one or more computer program products. The program code 1110 may be compressed, for example, in a suitable form.
Referring to fig. 12, a block diagram 1200 of a computer program product according to an embodiment of the present application is shown. Included in the computer program product 1200 are computer programs/instructions 1210, which computer programs/instructions 1210, when executed by a processor, implement the steps of the above-described methods.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not necessarily depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.
Claims (14)
1. A switch assembly is characterized by comprising a main control module, a transmitting module, a receiving module and a switch unit, wherein the main control module is respectively connected with the transmitting module and the receiving module;
the emitting module corresponds to a detection area and is used for emitting optical signals to the detection area;
the switch unit comprises at least two switch states and at least two reflecting surfaces, each switch state corresponds to one reflecting surface, the reflecting parameters of different reflecting surfaces are different, and the reflecting surfaces of the switch unit in different switch states in the detection area are different;
the receiving module is used for receiving the optical signal reflected by a reflecting surface in the detection area;
the main control module is used for acquiring intensity parameters corresponding to the optical signals received by the receiving module and determining the current switch state of the switch unit based on the intensity parameters.
2. The switch assembly of claim 1, wherein the switch unit includes a sliding assembly and a light reflecting assembly, the sliding assembly is configured to move the light reflecting assembly, the sliding assembly corresponds to at least two travel positions, each travel position corresponds to one switch state, the light reflecting assembly includes a plurality of light reflecting surfaces, the sliding assembly is at different travel positions, and the different light reflecting surfaces of the light reflecting assembly are located in the detection area.
3. The switch assembly of claim 1, wherein the reflection parameter is reflectivity, and the intensity parameter is a power value, and the power value is positively correlated with the reflectivity.
4. The switch assembly of claim 3, wherein the switch state and the reflective surface are three, and the three reflective surfaces are a black reflective surface, a gray reflective surface, and a white reflective surface, respectively.
5. An electronic device, comprising: a middle frame and a switch assembly according to any one of claims 1-4, the switch assembly being provided to the middle frame.
6. The electronic device of claim 5, wherein the switch unit comprises a sliding component and a light reflecting component, the sliding component is connected with the light reflecting component, the sliding component is used for driving the light reflecting component to move, the transmitting module, the receiving module and the light reflecting component are installed in a cavity formed by the middle frame, and the sliding component is exposed on the surface of the middle frame.
7. The electronic device according to claim 6, wherein the cavity formed by the middle frame includes a first cavity and a second cavity, an optical channel is disposed between the first cavity and the second cavity, the light reflecting component is located in the first cavity, the emitting module and the receiving module are located in the second cavity, the optical signal emitted by the emitting module is emitted into the first cavity through the optical channel, and is reflected by the light reflecting component in the first cavity and then received by the receiving module through the optical channel.
8. The electronic device according to claim 7, wherein a plate body is disposed between the first cavity and the second cavity, the plate body is provided with a through hole, the through hole serves as the optical channel, and the through hole vertically extends to a region of the reflection assembly to serve as a detection region.
9. The electronic device according to claim 8, wherein a circuit board is disposed in the second cavity, the emitting module and the receiving module are both mounted on the circuit board, a light guide pillar is disposed on an end surface of the board body facing the second cavity, the light guide pillar includes a first light transmission region and a second light transmission region, the first light transmission region and the second light transmission region are spaced apart and are both located at the through hole, a region of the light guide pillar except the first light transmission region and the second light transmission region is a light shielding region, the light signal emitted by the emitting module is sequentially emitted into the first cavity through the first light transmission region and the light channel, and the light signal reflected by the light reflecting component in the first cavity is sequentially received by the receiving module through the light channel and the second light transmission region.
10. The electronic device of claim 9, wherein a waterproof adhesive is filled between an end surface of the plate body facing the second cavity and the light guide pillar.
11. The electronic device of claim 10, wherein an optical isolation module is disposed between the transmitter module and the receiver module, and the optical isolation module is configured to prevent the receiver module from directly coupling the optical signal transmitted by the transmitter module.
12. A switching state detection method applied to the switching assembly according to any one of claims 1 to 4, the method comprising:
controlling the transmitting module to transmit a first signal to the current reflecting surface of the switch unit at a first power value;
acquiring a second power value of a second signal, wherein the second signal comprises the first signal which is received by the receiving module and reflected by the current reflecting surface;
and determining the current switching state of the switching unit based on the second power value.
13. The method of claim 12, further comprising:
and controlling the electronic equipment to work in a target working state based on the current switching state of the switching unit.
14. The method according to claim 13, wherein the current switching state of the switching unit comprises a first state, a second state or a third state, the target operating state comprises a ringing state, a vibration state or a mute state, and the controlling the electronic device to operate in the target operating state based on the current switching state of the switching unit comprises:
if the current switching state of the switching unit is the first state, controlling the electronic equipment to work in the ringing state;
if the current on-off state of the switch unit is the second state, controlling the electronic equipment to work in the vibration state;
and if the current switching state of the switching unit is the third state, controlling the electronic equipment to work in the mute state.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211176788.2A CN115632646A (en) | 2022-09-26 | 2022-09-26 | Switch assembly, electronic device and switch state detection method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211176788.2A CN115632646A (en) | 2022-09-26 | 2022-09-26 | Switch assembly, electronic device and switch state detection method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115632646A true CN115632646A (en) | 2023-01-20 |
Family
ID=84902513
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211176788.2A Pending CN115632646A (en) | 2022-09-26 | 2022-09-26 | Switch assembly, electronic device and switch state detection method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115632646A (en) |
-
2022
- 2022-09-26 CN CN202211176788.2A patent/CN115632646A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10650789B2 (en) | Method and apparatus for controlling display screen statuses | |
US10403232B2 (en) | Method of controlling display screen states, and apparatus | |
CN107884066A (en) | Optical sensor and its 3D imaging devices based on flood lighting function | |
WO2018161739A1 (en) | Method and device for controlling state of display screen, storage medium, and terminal | |
WO2016115818A1 (en) | Integrated optical-to-electrical touch screen and apparatus, electronic device, and touch recognition method and system | |
CN107845627B (en) | Multiple proximity detection light sensor | |
CN115280751B (en) | Multi-path imaging techniques and shared transmitters for active depth sensing techniques | |
US10914823B2 (en) | Time of flight ranging with varying fields of emission | |
CN107064948B (en) | Sensor module and mobile terminal | |
US20200191966A1 (en) | Electronic device with improved work surface adaptability | |
US9562922B2 (en) | Light sensor and electronic device | |
CN107959752B (en) | Display screen state control method and device, storage medium and terminal | |
WO2022028470A1 (en) | Electronic device and infrared module control method | |
CN115632646A (en) | Switch assembly, electronic device and switch state detection method | |
CN107665081B (en) | Display screen state control method and device, storage medium and terminal | |
CN110969126B (en) | Display device | |
CN100461080C (en) | Optical operation perception device | |
CN107506049B (en) | Display screen state control method and device, storage medium and terminal | |
CN107561833B (en) | Projector with a light source | |
CN105426876A (en) | Fingerprint reading device and control module thereof | |
CN104704745A (en) | Multiple function arrangement for electronic apparatus and method thereof | |
US20160085345A1 (en) | Touch-sensing apparatus, touch system, and touch-detection method | |
CN111765852A (en) | Rotation angle recognition device, electronic device and rotation angle recognition method thereof | |
TWI786682B (en) | Optical mouse and its control method | |
KR20210111481A (en) | Multi-optical axis sensor |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |