WO2020024711A1 - 滑动组件的滑动控制方法、装置、电子装置及存储介质 - Google Patents
滑动组件的滑动控制方法、装置、电子装置及存储介质 Download PDFInfo
- Publication number
- WO2020024711A1 WO2020024711A1 PCT/CN2019/091542 CN2019091542W WO2020024711A1 WO 2020024711 A1 WO2020024711 A1 WO 2020024711A1 CN 2019091542 W CN2019091542 W CN 2019091542W WO 2020024711 A1 WO2020024711 A1 WO 2020024711A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- hall element
- electronic device
- sliding
- sliding component
- component
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04M—TELEPHONIC COMMUNICATION
- H04M1/00—Substation equipment, e.g. for use by subscribers
- H04M1/02—Constructional features of telephone sets
- H04M1/0202—Portable telephone sets, e.g. cordless phones, mobile phones or bar type handsets
- H04M1/026—Details of the structure or mounting of specific components
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B15/00—Systems controlled by a computer
- G05B15/02—Systems controlled by a computer electric
Definitions
- the present application relates to the field of electronic technology, and in particular, to a sliding control method, device, electronic device, and storage medium of a sliding component.
- the present application provides a sliding control method, device, electronic device and storage medium of a sliding component.
- the present application discloses a sliding control method for a sliding component.
- the driving component is configured to control the sliding component to slide between a first position received in the body and a second position exposed from the body.
- the detection component includes a magnetic field generating element, a first Hall element, and a second Hall element.
- the magnetic field generating element is fixed to the sliding component, and the first Hall element and the second Hall element are fixed to the sliding element.
- the first Hall element is disposed below the second Hall element, and the sliding control method includes the following steps:
- the sliding component is switched from manual operation to automatic operation, and the driving component is started to control the sliding component to slide out from the first position to Second position.
- the sliding control method of the sliding component receives an interrupt signal from the first Hall element, and obtains a first detection signal value currently output by the first Hall element after delaying the first delay time, and compares the first A detection signal value and a preset calibration signal value, and when the first detection signal value is less than the preset calibration signal value, the sliding component is switched from manual operation to automatic operation, and the driving component is started to control the sliding component from the first The position slides out to the second position. Therefore, while avoiding the occurrence of misjudgment caused by the interference of the Hall element with other magnetic fields, the intelligent control sliding component slides out from the first position to the second position without other operations by the user, which is convenient for the user.
- the present application discloses a sliding control device for a sliding component.
- the sliding component is used for an electronic device.
- the electronic device includes a main body, a detecting component, and a driving component.
- the driving component is used to control the sliding component to be accommodated in a place. Sliding between a first position of the body and a second position exposed from the body, the detection component includes a magnetic field generating element, a first Hall element, and a second Hall element, and the magnetic field generating element is fixed to the A sliding assembly, the first Hall element and the second Hall element are fixed on the body, the first Hall element is disposed below the second Hall element, and the slide control device includes :
- a first acquisition module configured to acquire a first interrupt signal sent by the first Hall element, where the first interrupt signal is a detection signal value detected and output by the first Hall element that is greater than a preset calibration signal value Sent later
- a second acquisition module is configured to start timing according to a preset first delay corresponding to the first interrupt signal, and when the first delay is reached, obtain a first output currently output by the first Hall element. Detection signal value
- a first control module configured to switch the sliding component from manual operation to automatic operation when it is learned that the value of the first detection signal is less than the value of the calibration signal, and start the driving component to control the sliding component from The first position slides out to the second position.
- the sliding control device of the sliding component receives the interrupt signal of the first Hall element, and obtains the first detection signal value currently output by the first Hall element after delaying the first delay time, and compares the first A detection signal value and a preset calibration signal value, and when the first detection signal value is less than the preset calibration signal value, the sliding component is switched from manual operation to automatic operation, and the driving component is started to control the sliding component from the first The position slides out to the second position. Therefore, while avoiding the occurrence of misjudgment caused by the interference of the Hall element with other magnetic fields, the intelligent control sliding component slides out from the first position to the second position without other operations by the user, which is convenient for the user.
- the present application discloses an electronic device.
- the electronic device includes a body, a sliding component, a detecting component, and a driving component.
- the driving component is used to control the sliding component at a first position received in the body and from the first position.
- the body is slid between the exposed second positions.
- the detection component includes a magnetic field generating element, a first Hall element, and a second Hall element.
- the magnetic field generating element is fixed to the sliding element.
- the first Hall element And the second Hall element is fixed on the body, the first Hall element is disposed below the second Hall element
- the electronic device further includes: a memory, and the sliding component, the The detection component, the processor electrically connected to the driving component, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the sliding control of the sliding component of the foregoing embodiment is implemented. method.
- the present application discloses a computer-readable storage medium on which a computer program is stored, which is implemented by a processor to implement a sliding control method of a sliding component.
- the present application discloses a computer program product.
- instructions in the computer program product are executed by a processor, a sliding control method of a sliding component is performed.
- FIG. 1 is a schematic diagram of a state of an electronic device in a second position according to an embodiment of the present application
- FIG. 2 is a schematic diagram of a state of an electronic device in a first position according to an embodiment of the present application
- FIG. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
- FIG. 4 is another schematic structural diagram of an electronic device according to an embodiment of the present application.
- FIG. 5 is another schematic structural diagram of an electronic device according to an embodiment of the present application.
- FIG. 6 is a schematic flowchart of a sliding control method of a sliding component according to an embodiment of the present application.
- FIG. 7 is a schematic flowchart of a sliding control method of a sliding component according to another embodiment of the present application.
- FIG. 8 is a schematic flowchart of a sliding control method for a sliding component according to another embodiment of the present application.
- FIG. 9 is a schematic flowchart of a sliding control method of a sliding component according to another embodiment of the present application.
- FIG. 10 is a schematic flowchart of a sliding control method for a sliding component according to another embodiment of the present application.
- FIG. 11 is a schematic structural diagram of a sliding control device of a sliding component according to an embodiment of the present application.
- FIG. 12 is a schematic structural diagram of a sliding control device of a sliding component according to another embodiment of the present application.
- FIG. 13 is a schematic structural diagram of a sliding control device of a sliding component according to another embodiment of the present application.
- FIG. 14 is a schematic structural diagram of a slide control device of a slide assembly according to another embodiment of the present application.
- Electronic device 100 main body 10, main board 12, chute 16, groove 162, sliding assembly 20, carrier 22, threaded hole 24, turning screw 26, memory 30, processor 31, camera 42, earpiece 44, driving assembly 50.
- Drive motor 52 detection assembly 60, magnetic field generating element 61, first Hall element 62, second Hall element 63, distance sensor 70, first distance sensor 71, second distance sensor 72, first position A, Second position B, slide control device 80, first acquisition module 110, second acquisition module 120, first control module 130, third acquisition module 140, fourth acquisition module 150, second control module 160, providing module 170,
- first and second are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as “first” and “second” may explicitly or implicitly include one or more of the features. In the description of the present application, the meaning of "a plurality" is two or more, unless specifically defined otherwise.
- the "first" or “under” of the second feature may include the first and second features in direct contact, and may also include the first and second features. Not directly, but through another characteristic contact between them.
- the first feature is “above”, “above”, and “above” the second feature, including that the first feature is directly above and obliquely above the second feature, or merely indicates that the first feature is higher in level than the second feature.
- the first feature is “below”, “below”, and “below” of the second feature, including the fact that the first feature is directly below and obliquely below the second feature, or merely indicates that the first feature is less horizontal than the second feature.
- the electronic device 100 includes a main body 10, a sliding component 20, a driving component 50, and a detecting component 60.
- the driving component 50 is used to control the sliding component 20 in the first portion accommodated in the main body 10.
- a position A slides between a position A and a second position B exposed from the body 10.
- the detection assembly 60 includes a magnetic field generating element 61, a first Hall element 62, and a second Hall element 63.
- the magnetic field generating element 61 Fixed to the sliding assembly 20, the first Hall element 62 and the second Hall element 63 are fixed to the body 10, and the first Hall element 62 is provided at the second Hall element below 63, the electronic device 100 may further include a memory 30, a processor 31 electrically connected to the sliding component 20, the driving component 50, and the detecting component 60, and a computer stored in the memory 30 and operable on the processor 31.
- a program, the processor 31 is configured to execute a sliding control method of a sliding component, that is, the processor 31 is configured to execute: obtaining a first interrupt signal sent by the first Hall element 62, where the first interrupt signal is the The first Hall element 62 detects the detection of the output.
- the signal is sent after the signal value is greater than a preset calibration signal value; the timer is started according to a preset first delay corresponding to the first interrupt signal, and when the first delay is reached, the first hall is acquired.
- the first detection signal value currently output by the element 62; if it is known that the first detection signal value is less than the calibration signal value, the sliding component 20 is switched from manual operation to automatic operation, and the driving component 50 is started to control The sliding assembly slides out from the first position to a second position.
- the electronic device 100 may include a camera 42, the sliding assembly 20 includes a carrier 22, and the camera 42 is disposed on the carrier 22.
- the camera 42 can slide along with the slide assembly 20.
- the user can turn on the camera 42 and close the camera 42 as the trigger signal, that is, when the user turns on the camera 42, the trigger slide component 20 slides out, and when the user turns off the camera 42, the slide component 20 slides back.
- the user only needs to turn on or off the camera according to the existing habits, and does not need to perform additional operations on the sliding component 20, which can facilitate the use of the user.
- the camera 42 may be exposed from the main body 10 as the sliding component 20 slides out according to the user's input to work normally, or may be accommodated in the main body 10 as the sliding component 20 slides back according to the user's input. Inside. In this way, it is possible to provide as few through holes in the display assembly (not shown) as possible, which is beneficial to meet the design requirements of the full screen of the electronic device 100.
- the body 10 is formed with a sliding slot 16, and the sliding assembly 20 is located in the sliding slot 16 in the second position B. In this way, the sliding assembly 20 can be caused to slide between the first position A and the second position B through the sliding groove 16.
- the sliding assembly 20 includes a threaded hole 24 disposed in a middle portion of the carrier 22 and a rotating screw rod 26 matched with the threaded hole 24.
- the chute 16 includes a groove 162 opposite to the screw hole 24 and located at the bottom of the chute 16.
- the electronic device 100 includes a driving assembly 50 disposed in the groove 162.
- the driving assembly 50 includes a driving motor 52 connected to the processor 31 and an output shaft (not shown) connected to the bottom of the rotating screw rod 26.
- the processor 31 can control the sliding of the sliding component 20 by controlling the driving motor 52.
- the processor 31 controls the driving motor 52 to rotate forward, so that the output shaft drives the rotation screw 26 to rotate in the threaded hole 24, thereby making the sliding assembly 20 Slide from the first position A to the second position B.
- the processor 31 controls the driving motor 52 to reverse, so that the output shaft drives the rotating screw rod 26 to rotate in the threaded hole 24, thereby making the sliding assembly 20 Slide from the second position B to the first position A.
- “from the first position A to the second position B” and “from the second position B to the first position A” here refer to the direction of sliding, rather than the starting and ending points of sliding.
- the position of the sliding component 20 relative to the body 10 can be determined in various ways.
- the current relative position of the sliding assembly 20 relative to the body 10 can be determined by a magnet and a magnetic field detector. It should be noted that the number of magnetic field detectors may be one or more. In the embodiment of the present application, the number of magnetic field detectors is one.
- FIG. 3 illustrates a schematic diagram of a mechanism in which the magnetic field generating element 61 is disposed on the sliding assembly 20, and the first Hall element 62 and the second Hall element 63 are disposed on the body.
- the Hall element can sense the magnetic field generated by the magnetic field generating element 61, and output a corresponding signal according to the induced magnetic induction strength to determine the sliding component 20 relative to the body. 10's current relative position. Since the magnetic induction strength is related to the current relative position of the relative magnetic field generating element 61, the relative position of the Hall element and the magnetic field generating element 61 can be determined by the detection signal value output by the Hall element.
- the magnetic field generating element 61 is disposed on the sliding assembly 20 and the Hall element is fixedly disposed on the body 10, the magnetic field generating element 61 and the Hall element can generate relative motion with the movement of the sliding assembly 20, and therefore, can be determined by The relative position of the Hall element and the magnetic field generating element 61 indirectly determines the relative position of the sliding component 20 relative to the body 10.
- the relative position of the sliding component 20 relative to the body 10 can be determined by the first Hall element 62 and / or the second Hall element in the embodiment of the present application.
- the sliding component 20 can be slid to multiple calibration relative positions in advance, and the detection signal value output by the Hall element corresponding to each calibration relative position can be obtained as a preset signal value corresponding to the calibration relative position, and then Associate multiple preset signal values and multiple calibrated relative positions into a lookup table or fit a relationship curve.
- the lookup table or relationship curve includes multiple preset signal values and multiple calibrated relative positions. Each preset signal The value corresponds to a calibrated relative position. Therefore, after the processor 31 receives the detection signal value output by the Hall element, the processor 31 may query a pre-generated lookup table or relationship curve according to the detection signal value of the Hall element, so as to determine that the sliding component 20 is relative to the body 10 and derived backward. The current relative position of.
- the current relative position of the sliding component 20 relative to the body 10 can be determined by the distance sensor.
- the distance sensor may be any sensor capable of detecting distance, such as an infrared distance sensor or an ultrasonic displacement sensor.
- the sliding component 20 is provided with a distance sensor 70.
- the distance sensors 70 are at least two, and the connecting line between the at least two distance sensors 70 is not perpendicular to the sliding direction of the sliding component 20.
- the processor 31 is further configured to receive detection signal values of at least two distance sensors 70; and determine a current relative position of the sliding component 20 relative to the body 10 according to the at least two detection signal values.
- the sliding component 20 is provided with a first distance sensor 71 and a second distance sensor 72, and a line between the first distance sensor 71 and the second distance sensor 72 is flat with the sliding direction of the sliding component 20.
- the behavior examples are shown.
- the following uses the first distance sensor 71 and the second distance sensor 72 as infrared distance sensors as an example to describe the process of the processor 31 determining the current loudness position of the sliding component 20 relative to the body 10 in the embodiment of the present application.
- the current relative position of the sliding component 20 relative to the main body 10 is determined mainly based on the characteristics of the first distance sensor 71 and the second distance sensor 72 having a ranging function.
- the infrared distance sensor includes an infrared transmitting tube and an infrared receiving tube. When the infrared emitted by the transmitting tube is received by the receiving tube for a short time, it indicates that the distance is short; when the infrared receiving time of the receiving tube is long, it indicates that the distance is relatively short. far.
- the measured distance is the relative distance between the first distance sensor 71 and the second distance sensor 72 and the body 10.
- the distances of the first distance sensor 71 and the second distance sensor 72 relative to the body 10 are determined according to the sum of the sensing distances of the first distance sensor 71 and the second distance sensor 72. Because the length of time is related to the position of the first distance sensor 71 and the second distance sensor 72, and the length of time is related to the length of the distance, the longer the sliding distance of the sliding component 20 is, the longer the receiving time is. It can be determined whether the sliding assembly 20 is located between the first position A, the second position B, or between the first position A and the second position B. Therefore, the current relative positions of the first and second distance sensors 71 and 72 relative to the body 10 can be determined by the signals output by the first and second distance sensors 71 and 72.
- the first distance sensor 71 and the second distance sensor 72 are respectively fixed on the sliding component 20, the first distance sensor 71 and the second distance sensor 72 can generate relative movement with the movement of the sliding component 20, and therefore, can be determined by The positions of the second distance sensor 72 and the first distance sensor 71 relative to the body 10 indirectly determine the current relative position of the sliding component 20 relative to the body 10.
- the sliding component 20 can be slid to a plurality of calibration relative positions in advance, and the detection signal values output by the first distance sensor 71 and the second distance sensor 72 corresponding to each calibration relative position can be obtained as the corresponding calibration positions.
- the preset signal value and then associate the multiple preset signal values with multiple calibration positions into a lookup table or a fitting relationship curve.
- the lookup table or relationship curve includes multiple preset signal values and multiple calibration relative positions. Each preset signal value corresponds to a calibrated relative position.
- the processor 31 may query a pre-generated lookup table or a relationship curve according to the detection signal values, so as to determine the backward derivation of the sliding component 20 The current relative position relative to the body 10.
- the electronic device 100 in this embodiment includes a main body 10, a sliding component 20, a driving component 50, and a detecting group 60.
- the driving component 50 is used to control the sliding component 20 in the first portion of the main body 10.
- the detection assembly 60 includes a magnetic field generating element 61, a first Hall element 62, and a second Hall element 63.
- the magnetic field generating element 61 is fixed on the sliding assembly 20.
- a Hall element 62 and a second Hall element 63 are fixed on the body 10, and the first Hall element 62 is disposed below the second Hall element 63.
- FIG. 6 is a schematic flowchart of a sliding control method for a sliding component according to an embodiment of the present application.
- the sliding control method includes the following steps:
- Step 601 Obtain a first interrupt signal sent by the first Hall element.
- the first interrupt signal is sent after the detection signal value detected by the first Hall element is greater than a preset calibration signal value.
- the first Hall element in the electronic device determines a corresponding detection signal value according to the induced magnetic induction intensity. After the first Hall element detects that the output detection signal value is greater than a preset calibration signal value, the first Hall element sends a first interrupt signal.
- Step 602 Start timing according to a preset first delay corresponding to the first interrupt signal, and when the first delay is reached, obtain a first detection signal value currently output by the first Hall element.
- the first detection signal value After receiving the first interrupt signal sent by the first Hall element, in order to avoid misjudgment due to interference of the first Hall element with other magnetic fields, according to the first interrupt signal and the pre-stored interrupt signal, Correspondence between the delays, obtain the first delay corresponding to the first interrupt signal, and start timing according to the first delay, and after detecting that the first delay is reached, read the current output of the first Hall element The first detection signal value.
- the first delay is set by default in the electronic device, or is preset by the user in the electronic device according to requirements.
- the first delay may be 10 milliseconds.
- step 603 if it is known that the value of the first detection signal is less than the value of the calibration signal, the sliding component is switched from manual operation to automatic operation, and the driving component is started to control the sliding component to slide out from the first position to the second position.
- the user has no trouble in performing another operation on the sliding component, so as to facilitate the use of the user.
- the first detection signal value can be compared with the calibration signal value. If the comparison shows that the first detection signal value is less than the calibration signal value, the sliding component is manually changed from The operation is switched to automatic operation, and the driving component is started to control the sliding component to slide out from the first position to the second position. Therefore, the intelligent control sliding component slides out from the first position to the second position without other operations by the user, which is convenient for the user.
- the first detection signal value is smaller than the calibration signal value, it means that the sliding component is moving away from the calibration point.
- the comparison shows that the value of the first detection signal exceeds the calibration signal value, it means that the first Hall element may be affected by other objects generated by the surrounding magnetic field, and the current value of the first detection signal exceeds Calibration signal value.
- the switching function of controlling the sliding component from manual operation to automatic operation is turned off.
- the sliding control method of the sliding component of this embodiment in order to avoid the Hall element being affected by other magnetic fields, causing the manual operation of the sliding component to be switched to the automatic operation by mistake, causing misjudgment, and then controlling the sliding The components slide in and out, causing losses to the sliding components and power consumption of the electronic device.
- the timer After receiving the interrupt signal of the first Hall element, the timer is started according to a preset first delay corresponding to the first interrupt signal. When the first delay is reached, the first output of the first Hall element is obtained.
- the detection signal value and when the first detection signal value is less than the calibration signal value, the sliding component is switched from manual operation to automatic operation, and the driving component is started to control the sliding component to slide out from the first position to the second position.
- the sliding control method of the sliding component receives an interrupt signal of the first Hall element, and obtains a first detection signal value currently output by the first Hall element after delaying the first delay time, and compares the first A detection signal value and a preset calibration signal value, and when the first detection signal value is less than the preset calibration signal value, the sliding component is switched from manual operation to automatic operation, and the driving component is started to control the sliding component from the first The position slides out to the second position. Therefore, while avoiding the occurrence of misjudgment caused by the interference of the Hall element with other magnetic fields, the intelligent control sliding component slides out from the first position to the second position without other operations by the user, which is convenient for the user.
- the second Hall can be received at this time.
- the second interrupt signal sent by the element starts timing according to a preset second delay corresponding to the second interrupt signal.
- the sliding component gradually approaches the second Hall element, and the second The value of the second detection signal currently output by the Hall element is greater than the value of the calibration signal.
- the drive component controls The sliding assembly slides out from the first position to the second position.
- the method may further include:
- Step 701 Obtain a second interrupt signal sent by the second Hall element.
- the second interrupt signal is sent after the second Hall element detects that the output detection signal value is greater than a preset calibration signal value.
- the second Hall element in the electronic device determines a corresponding detection signal value according to the induced magnetic induction intensity. After the second Hall element detects that the output detection signal value is greater than a preset calibration signal value, the second Hall element sends a second interrupt signal.
- Step 702 Start timing according to a preset second delay corresponding to the second interrupt signal, and when the second delay is reached, obtain a second detection signal value currently output by the second Hall element.
- the second interrupt signal sent by the second Hall element in order to avoid misjudgment due to interference of the second Hall element with other magnetic fields, according to the second interrupt signal and the pre-stored interrupt signal and Correspondence between the delays, obtain a second delay corresponding to the second interrupt signal, and start timing according to the second delay, and after detecting that the second delay is reached, read the current output of the second Hall element Value of the second detection signal.
- step 703 if it is known that the second detection signal value is less than the calibration signal value, the sliding component is switched from manual operation to automatic operation, and the driving component is started to control the sliding component to slide from the second position to the first position.
- the user has no trouble in performing another operation on the sliding component to facilitate the user's use.
- the second detection signal value can be compared with the calibration signal value. If the comparison shows that the second detection signal value is less than the calibration signal value, the sliding component is manually changed from The operation is switched to automatic operation, and the driving component is controlled to slide the sliding component from the second position to the first position. Therefore, the intelligent control sliding component slides out from the second position to the second position without other operations by the user, which is convenient for the user.
- the second detection signal value is smaller than the calibration signal value, it means that the sliding component is moving away from the calibration point.
- the value of the second detection signal exceeds the calibration signal value, it means that the second Hall element may be affected by other objects generated by the surrounding magnetic field, and the current output second detection signal value exceeds Calibration signal value.
- the switching function of controlling the sliding component from manual operation to automatic operation is turned off.
- the sliding control method of the sliding component in order to avoid the Hall element being affected by other magnetic fields, causing the manual operation of the sliding component to be switched to automatic operation by mistake, resulting in misjudgment, and then controlling The sliding component slides in and out, causing losses to the sliding component and power consumption of the electronic device.
- After receiving the interrupt signal of the second Hall element it starts according to a preset second delay corresponding to the second interrupt signal.
- the sliding component is switched from manual operation to automatic operation, and started
- the driving component controls the sliding component to slide from the second position to the first position. Therefore, while avoiding the occurrence of misjudgment caused by the interference of the Hall element with other magnetic fields, the intelligent control sliding component is slid from the second position to the first position without other operations by the user, which is convenient for the user.
- the detection signal value output by the first Hall element and the second Hall element may be larger than the corresponding calibration signal value.
- the first delay time corresponding to the first interrupt signal can be obtained to start timing, and when the first delay time is reached, the time delay is obtained.
- the sliding component is manually operated to automatic operation.
- the switching function continues to be closed, thereby avoiding repeated sliding in and out of the sliding component, and reducing the loss of the sliding component.
- the method may further include:
- Step 801 Provide a control interface to obtain a calibration signal value set by the user on the control interface according to requirements.
- the manual operation to automatic operation switching function of the sliding component can be disabled, and Prompts the user to set the corresponding calibration signal value of the sliding component to slide out and / or slide in in the control interface.
- the calibration signal values corresponding to the sliding out of the sliding component and the sliding in may be the same or different.
- the user may be prompted to manually slide the sliding component to a desired calibration position.
- the current value of the first Hall element is obtained.
- the user can personally set the calibration signal value corresponding to the sliding component sliding out through the control interface, which meets the user's need to personally set the calibration signal value.
- the user may be prompted to slide the sliding component from the second position to a desired calibration position, and when the user slides the sliding component from the second position to the calibration position, the second The current output detection signal value of the Hall element, and the current output detection signal value as the corresponding calibration signal value when the sliding component slides out, and after receiving the user's confirmation instruction, save the calibration signal value to the processor's reserve Partition, and save the calibration signal value to the hardware register of the second Hall element through the system interface.
- the user can personally set the calibration signal value corresponding to the sliding component sliding through the control interface to meet the needs of the user to personally set the calibration signal value.
- Step 802 After detecting that the electronic device is started, write a calibration signal value to a hardware register of the first Hall element and the second Hall element.
- the corresponding calibration signal value may be stored in a reserve partition of the processor.
- the corresponding interface After detecting the startup of the electronic device, the corresponding interface may be called, and the corresponding calibration signal value stored in the reserve partition is correspondingly written into the hardware registers of the first Hall element and the second Hall element. Therefore, the calibration signal value set by the user is written into the hardware registers of the first Hall element and the second Hall element, so that subsequent Hall elements determine whether to send an interrupt based on the currently output detection signal value and the calibration signal value. signal.
- the electronic device in order to improve the intelligence of the electronic device and avoid the interruption signal of the Hall element caused by the influence of other objects capable of generating a magnetic field during the use of the electronic device, the electronic device is automatically controlled.
- the sliding component slides in or out, which avoids the loss of the sliding component.
- the method may further include:
- Step 901 monitoring whether the electronic device satisfies a preset proximity event through a proximity sensor.
- step 902 if it is detected that the electronic device satisfies a preset approach event, a first state is written in the underlying driving node, instructing to close the switching function of the manual operation of the sliding component to the automatic operation.
- step 903 if it is detected that the electronic device does not meet the preset approach event, a second state is written in the underlying driving node, and an instruction is provided to enable the switching function of the manual operation of the sliding component to the automatic operation.
- a second state can be written in the underlying drive node to instruct the sliding component to be opened manually Switching function from running to automatic running.
- the proximity sensor is used to monitor whether the electronic device satisfies a preset proximity event, and when it is detected that the electronic device satisfies a preset proximity event, a first state is written in the underlying driving node, instructing to close the sliding component to manually run to Automatic operation switching function, which can prevent the electronic device from being affected by other objects that can generate magnetic fields during use, and automatically control the sliding component of the electronic device to slide in or out according to the interrupt signal of the Hall element This situation avoids the loss of the sliding components.
- a second state is written in the underlying drive node, instructing to enable the switching function of the manual operation of the sliding component to the automatic operation, thereby making the electronic device in the subsequent use process.
- the sliding component can be automatically slid in and out by the driving component without the user having to perform another operation on the sliding component, which is convenient for the user.
- the electronic device when the electronic device is in a bright screen state, sometimes a user's body part, such as a hand, may approach the electronic device.
- the proximity sensor in the electronic device detects the proximity event and reports it.
- Proximity event at this time, if the switching function of the manual operation to the automatic operation of the sliding component is turned off according to the reported approach event, the electronic device automatically finishes sliding in and out of the sliding component.
- the sliding component performs another operation, for example, the user manually slides the sliding component in and out, which results in a poor user experience of the electronic device.
- the method may further include:
- Step 101 Monitor the screen state of the electronic device.
- step 102 if it is detected that the electronic device is in a bright screen state, the second state written by the underlying driving node is locked, and the state modification of the second state is prohibited when the electronic device meets a preset approach event.
- step 103 if it is detected that the electronic device is in the off-screen state, the second state written by the underlying driver node is unlocked, allowing the second state to be changed to the first state when the electronic device meets a preset approach event.
- the second state written to the underlying driving node is locked, so that the electronic device starts the switching function from manual operation to automatic operation of the sliding component. Therefore, it is convenient for the subsequent use of the electronic device, when the detection signal value output by the Hall element meets the requirements, the sliding component is controlled to slide in and out by the driving component, thereby eliminating the need for the user to perform additional operations on the sliding component, which is convenient. User use.
- the second state written to the underlying driving node is unlocked, thereby allowing the second state to be changed to the first state when the electronic device meets a preset approach event. Therefore, when the electronic device is in the off-screen state, the sliding component can be manually switched to automatic operation due to other objects that generate magnetic fields, thereby causing the sliding component to repeatedly slide out and slide in, thereby reducing the sliding component. Consumption, reduce power consumption of electronic devices, and improve user experience.
- the Hall element in the electronic device can sense the magnetic induction output. Corresponding detection signal value. If the output value of the detection signal detected by the Hall element is greater than the preset calibration signal, the Hall element sends an interrupt signal. After receiving the interrupt signal, it obtains the delay corresponding to the interrupt signal, and After delaying the corresponding time, obtain the detection signal value currently output by the Hall element. At this time, even if it is learned through comparison that the currently output detection signal value is less than the preset calibration signal value, the sliding component in the electronic device cannot be switched from manual operation to automatic operation.
- FIG. 11 is a schematic structural diagram of a sliding control device of a sliding component according to an embodiment of the present application.
- the electronic device 100 includes a main body 10, a sliding component 20, a driving component 50, and a detecting group 60.
- the driving component 50 is used to control the sliding component 20 in a first position received in the main body 10 and exposed from the main body 10.
- the detection assembly 60 includes a magnetic field generating element 61, a first Hall element 62, and a second Hall element 63.
- the magnetic field generating element 61 is fixed on the sliding assembly 20, and the first Hall element 62 and the first The two Hall elements 63 are fixed on the body 10, and the first Hall element 62 is disposed below the second Hall element 63.
- the slide control device 80 may include a first acquisition module 110 and a second acquisition Module 120 and first control module 130, where:
- the first acquiring module 110 is configured to acquire a first interrupt signal sent by the first Hall element, and the first interrupt signal is sent after the detection signal value detected by the first Hall element is greater than a preset calibration signal value.
- the second obtaining module 120 is configured to start timing according to a preset first delay corresponding to the first interrupt signal, and when the first delay is reached, obtain a first detection signal value currently output by the first Hall element.
- the first control module 130 is configured to switch the sliding component from manual operation to automatic operation when it is known that the value of the first detection signal is less than the calibration signal value, and start the driving component to control the sliding component to slide out from the first position to the second position.
- the device may further include:
- the third obtaining module 140 is configured to obtain a second interrupt signal sent by the second Hall element, and the second interrupt signal is sent after the second Hall element detects that the output detection signal value is greater than a preset calibration signal value.
- the fourth obtaining module 150 is configured to start timing according to a preset second delay corresponding to the second interrupt signal, and when the second delay is reached, obtain a second detection signal value currently output by the second Hall element.
- the second control module 160 is configured to switch the sliding component from manual operation to automatic operation when it is learned that the value of the second detection signal is less than the calibration signal value, and start the driving component to control the sliding component to slide from the second position to the first position.
- the manual operation of the sliding component is switched to the automatic operation by mistake, resulting in a misjudgment, and then controlling the sliding component to slide in and out, causing losses to the sliding component And cause power consumption to the electronic device.
- the timer is started according to a preset second delay corresponding to the second interrupt signal.
- the second delay is reached, the second output currently obtained by the second Hall element is obtained.
- the detection signal value and when the second detection signal value is less than the calibration signal value, the sliding component is switched from manual operation to automatic operation, and the driving component is started to control the sliding component to slide from the second position to the first position.
- the device in order to meet a user's requirement for individually setting a calibration signal value for sliding in and / or out of a sliding component, based on FIG. 11, as shown in FIG. 13, the device may also include:
- the providing module 170 is configured to provide a control interface and obtain a calibration signal value set by the user on the control interface according to requirements.
- the sending module 180 is configured to write a calibration signal value to a hardware register of the first Hall element and the second Hall element after detecting that the electronic device is started.
- the user may be prompted to manually slide the sliding component to a desired calibration position.
- the current value of the first Hall element is obtained.
- the user may be prompted to slide the sliding component from the second position to a desired calibration position, and when the user slides the sliding component from the second position to the calibration position, the second The current output detection signal value of the Hall element, and the current output detection signal value as the corresponding calibration signal value when the sliding component slides out, and after receiving the user's confirmation instruction, save the calibration signal value to the processor's reserve Partition, and save the calibration signal value to the hardware register of the second Hall element through the system interface.
- the structures of the providing module 170 and the sending module 180 in the device embodiment in FIG. 13 may also be included in the device embodiment shown in FIG. 12, which is not limited in this embodiment.
- the device may further include:
- the judging module 190 is configured to monitor whether the electronic device satisfies a preset approach event by using a proximity sensor.
- the third processing module 200 is configured to detect that the electronic device satisfies a preset approach event, and write a first state in the underlying driving node to instruct to close the switching function of the manual operation of the sliding component to the automatic operation.
- the fourth processing module 210 is configured to write a second state at the underlying driving node when it is detected that the electronic device does not meet the preset approach event, and instruct to enable the switching function of the manual operation of the sliding component to the automatic operation.
- the proximity sensor is used to monitor whether the electronic device satisfies a preset proximity event, and when it is detected that the electronic device satisfies a preset proximity event, a first state is written in the underlying driving node, instructing to close the sliding component to manually run to Automatic operation switching function, which can prevent the electronic device from being affected by other objects that can generate magnetic fields during use, and automatically control the sliding component of the electronic device to slide in or out according to the interrupt signal of the Hall element This situation avoids the loss of the sliding components.
- a second state is written in the underlying drive node, instructing to enable the switching function of the manual operation of the sliding component to the automatic operation, thereby enabling the electronic device to automatically complete subsequent sliding.
- the components can be slid in and out without the user having to perform additional operations on the sliding components, which is convenient for users.
- the device may further include:
- the monitoring module 220 is configured to monitor a screen state of the electronic device.
- a locking module 230 is configured to lock the second state written by the underlying driving node when the electronic device is in a bright screen state, and prohibit the state of the second state when the electronic device meets a preset approach event. modify.
- An unlocking module 240 is used for unlocking the second state written by the underlying driver node when it is detected that the electronic device is in the off-screen state, allowing the second state to be changed to the first state when the electronic device meets a preset approach event status.
- the sliding control device of the sliding component receives the interrupt signal of the first Hall element, and obtains the first detection signal value currently output by the first Hall element after delaying the first delay time, and compares the first A detection signal value and a preset calibration signal value, and when the first detection signal value is less than the preset calibration signal value, the sliding component is switched from manual operation to automatic operation, and the driving component is started to control the sliding component from the first The position slides out to the second position. Therefore, while avoiding the occurrence of misjudgment caused by the interference of the Hall element with other magnetic fields, the intelligent control sliding component slides out from the first position to the second position without the user's other operations, which is convenient for the user.
- the present application also proposes a computer-readable storage medium on which a computer program is stored.
- the program is executed by a processor, the sliding control method of the sliding component of the above-mentioned embodiment is implemented.
- the present application also proposes a computer program product, and when the instructions in the computer program product are executed by a processor, the sliding control method of the sliding component of the above embodiment is executed.
Landscapes
- Engineering & Computer Science (AREA)
- Signal Processing (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Automation & Control Theory (AREA)
- User Interface Of Digital Computer (AREA)
- Telephone Function (AREA)
Abstract
本申请公开一种滑动组件的滑动控制方法、装置、电子装置及存储介质,该方法:获取第一霍尔元件发送的第一中断信号,第一中断信号是第一霍尔元件监测到输出的检测信号值大于预设的校准信号值后发送的;根据预设的与第一中断信号对应的第一延时开始计时,当到达第一延时后,获取第一霍尔元件当前输出的第一检测信号值;若比较获知第一检测信号值小于校准信号值,则将滑动组件从手动运行切换到自动运行,启动驱动组件控制滑动组件从第一位置滑出到第二位置。由此,在避免因霍尔元件受到其他磁场干扰,造成误判的情况发生的同时,智能控制滑动组件从第一位置滑出到第二位置,而无需用户进行其它操作,方便用户的使用。
Description
相关申请的交叉引用
本申请要求OPPO广东移动通信有限公司于2018年08月01日提交的、发明名称为“滑动组件的滑动控制方法、装置、电子装置及存储介质”的、中国专利申请号“201810860284.X”的优先权。
本申请涉及电子技术领域,尤其涉及一种滑动组件的滑动控制方法、装置、电子装置及存储介质。
为了提高用户体验,电子装置例如移动终端的屏占比越来越大,甚至已经有人提出全面屏的设计。
相关技术中,为了增大屏占比,一些电子设备通过将电子器件设置在滑动组件上,来隐藏原本设置在电子设备的前面板上的电子元件。如此,如何控制滑动组件成为亟待解决的问题。
发明内容
本申请提供一种滑动组件的滑动控制方法、装置、电子装置及存储介质。
本申请公开了一种滑动组件的滑动控制方法,所述驱动组件用于控制所述滑动组件在收容于所述本体的第一位置和自所述本体露出的第二位置之间滑动,所述检测组件包括磁场产生元件、第一霍尔元件和第二霍尔元件,所述磁场产生元件固定在所述滑动组件,所述第一霍尔元件和所述第二霍尔元件固定在所述本体上,所述第一霍尔元件设置在所述第二霍尔元件的下方,所述滑动控制方法包括以下步骤:
获取所述第一霍尔元件发送的第一中断信号,所述第一中断信号是所述第一霍尔元件监测到输出的检测信号值大于预设的校准信号值后发送的;
根据预设的与所述第一中断信号对应的第一延时开始计时,当到达所述第一延时后,获取所述第一霍尔元件当前输出的第一检测信号值;
若比较获知所述第一检测信号值小于所述校准信号值,则将所述滑动组件从手动运行切换到自动运行,启动所述驱动组件控制所述滑动组件从所述第一位置滑出到第二位置。
本申请实施方式的滑动组件的滑动控制方法,接收第一霍尔元件的中断信号,并在延时第一延时后,获取第一霍尔元件当前输出的第一检测信号值,并比较第一检测信号值与预设的校准信号值的大小,并在第一检测信号值小于预设的校准信号值时,将滑动组件从手动运行切换到自动运行,启动驱动组件控制滑动组件从第一位置滑出到第二位置。由此,在避免因霍尔元件受到其他磁场干扰,造成误判的情况发生的同时,智能控制滑动组件从第一位置滑出到第二位置,而无需用户进行其它操作,方便用户的使用。
本申请公开了一种滑动组件的滑动控制装置,所述滑动组件用于电子装置,所述电子装置包括本体、检测组件和驱动组件,所述驱动组件用于控制所述滑动组件在收容于所述本体的第一位置和自所述本体露出的第二位置之间滑动,所述检测组件包括磁场产生元件、第一霍尔元件和第二霍尔元件,所述磁场产生元件固定在所述滑动组件,所述第一霍尔元件和所述第二霍尔元件固定在所述本体上,所述第一霍尔元件设置在所述第二霍尔元件的下方,所述滑动控制装置包括:
第一获取模块,用于获取所述第一霍尔元件发送的第一中断信号,所述第一中断信号是所述第一霍尔元件监测到输出的检测信号值大于预设的校准信号值后发送的;
第二获取模块,用于根据预设的与所述第一中断信号对应的第一延时开始计时,当到达所述第一延时后,获取所述第一霍尔元件当前输出的第一检测信号值;
第一控制模块,用于在比较获知所述第一检测信号值小于所述校准信号值时,将所述滑动组件从手动运行切换到自动运行,启动所述驱动组件控制所述滑动组件从所述第一位置滑出到第二位置。
本申请实施方式的滑动组件的滑动控制装置,接收第一霍尔元件的中断信号,并在延时第一延时后,获取第一霍尔元件当前输出的第一检测信号值,并比较第一检测信号值与预设的校准信号值的大小,并在第一检测信号值小于预设的校准信号值时,将滑动组件从手动运行切换到自动运行,启动驱动组件控制滑动组件从第一位置滑出到第二位置。由此,在避免因霍尔元件受到其他磁场干扰,造成误判的情况发生的同时,智能控制滑动组件从第一位置滑出到第二位置,而无需用户进行其它操作,方便用户的使用。
本申请公开了一种电子装置,所述电子装置包括本体、滑动组件、检测组件和驱动组件,所述驱动组件用于控制所述滑动组件在收容于所述本体的第一位置和自所述本体露出的第二位置之间滑动,所述检测组件包括磁场产生元件、第一霍尔元件和第二霍尔元件,所述磁场产生元件固定在所述滑动组件,所述第一霍尔元件和所述第二霍尔元件固定在所述本体上,所述第一霍尔元件设置在所述第二霍尔元件的下方,所述电子装置还包括:存储器、与所述滑动组件、所述检测组件以及所述驱动组件电性连接的处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时,实现上述实施例的滑动组件的滑动控制方法。
本申请公开了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现滑动组件的滑动控制方法。
本申请公开了一种计算机程序产品,当计算机程序产品中的指令由处理器执行时,执行滑动组件的滑动控制方法。
本申请的附加方面和优点将在下面的描述中部分给出,部分将从下面的描述中变得明显,或通过本申请的实践了解到。
本申请的上述和/或附加的方面和优点从结合下面附图对实施方式的描述中将变得明显和容易理解,其中:
图1是本申请实施方式的电子装置在第二位置时的状态示意图;
图2是本申请实施方式的电子装置在第一位置时的状态示意图;
图3是本申请实施方式的电子装置的结构示意图;
图4是本申请实施方式的电子装置的另一结构示意图;
图5是本申请实施方式的电子装置的另一结构示意图;
图6是根据本申请一个实施例的滑动组件的滑动控制方法的流程示意图;
图7是根据本申请另一个实施例的滑动组件的滑动控制方法的流程示意图;
图8是根据本申请另一个实施例的滑动组件的滑动控制方法的流程示意图;
图9是根据本申请另一个实施例的滑动组件的滑动控制方法的流程示意图;
图10是根据本申请另一个实施例的滑动组件的滑动控制方法的流程示意图;
图11是根据本申请一个实施例的滑动组件的滑动控制装置的结构示意图;
图12是根据本申请另一个实施例的滑动组件的滑动控制装置的结构示意图;
图13是根据本申请另一个实施例的滑动组件的滑动控制装置的结构示意图;
图14是根据本申请另一个实施例的滑动组件的滑动控制装置的结构示意图。
主要元件符号说明:
电子装置100、本体10、主板12、滑槽16、凹槽162、滑动组件20、承载件22、螺纹孔24、转动丝杆26、存储器30、处理器31、相机42、听筒44、驱动组件50、驱动电机52、检测组件60、磁场产生元件61、第一霍尔元件62、第二霍尔元件63、距离传感器70、第一距离传感器71、第二距离传感器72、第一位置A、第二位置B、滑动控制装置80、第一获取模块110、第二获取模块120、第一控制模块130、第三获取模块140、第四获取模块150、第二控制模块160、提供模块170、发送模块180、判断模块190、第三处理模块200、第四处理模块210、监测模块220、加锁模块230和解锁模块240。
下面详细描述本申请的实施方式,所述实施方式的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施方式是示例性的,仅用于解释本申请,而不能理解为对本申请的限制。
在本申请的描述中,需要理解的是,术语“中心”、“纵向”、“横向”、“长度”、“宽度”、“厚度”、“上”、“下”、“前”、“后”、“左”、“右”、“竖直”、“水平”、“顶”、“底”、“内”、“外”、“顺时针”、“逆时针”等指示的方位或位置关系为基于附图所示的方位或位置关系,仅是为了便于描述本申请和简化描述,而不是指示或暗示所指的装置或元件必须具有特定的方位、以特定的方位构造和操作,因此不能理解为对本申请的限制。此外,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个所述特征。在本申请的描述中,“多个”的含义是两个或两个以上,除非另有明确具体的限定。
在本申请的描述中,需要说明的是,除非另有明确的规定和限定,术语“安装”、“相 连”、“连接”应做广义理解,例如,可以是固定连接,也可以是可拆卸连接,或一体地连接;可以是机械连接,也可以是电连接或可以相互通讯;可以是直接相连,也可以通过中间媒介间接相连,可以是两个元件内部的连通或两个元件的相互作用关系。对于本领域的普通技术人员而言,可以根据具体情况理解上述术语在本申请中的具体含义。
在本申请中,除非另有明确的规定和限定,第一特征在第二特征之“上”或之“下”可以包括第一和第二特征直接接触,也可以包括第一和第二特征不是直接接触而是通过它们之间的另外的特征接触。而且,第一特征在第二特征“之上”、“上方”和“上面”包括第一特征在第二特征正上方和斜上方,或仅仅表示第一特征水平高度高于第二特征。第一特征在第二特征“之下”、“下方”和“下面”包括第一特征在第二特征正下方和斜下方,或仅仅表示第一特征水平高度小于第二特征。
下文的公开提供了许多不同的实施方式或例子用来实现本申请的不同结构。为了简化本申请的公开,下文中对特定例子的部件和设置进行描述。当然,它们仅仅为示例,并且目的不在于限制本申请。此外,本申请可以在不同例子中重复参考数字和/或参考字母,这种重复是为了简化和清楚的目的,其本身不指示所讨论各种实施方式和/或设置之间的关系。此外,本申请提供了的各种特定的工艺和材料的例子,但是本领域普通技术人员可以意识到其他工艺的应用和/或其他材料的使用。
首先结合附图1-图5,对本申请提出的电子装置100进行详细说明。
如图1-图5所示,电子装置100包括本体10、滑动组件20、驱动组件50和检测组件60,所述驱动组件50用于控制所述滑动组件20在收容于所述本体10的第一位置A和自所述本体10露出的第二位置B之间滑动,所述检测组件60包括磁场产生元件61、第一霍尔元件62和第二霍尔元件63,所述磁场产生元件61固定在所述滑动组件20,所述第一霍尔元件62和所述第二霍尔元件63固定在所述本体10上,所述第一霍尔元件62设置在所述第二霍尔元件63的下方,该电子装置100还可以包括:存储器30、与滑动组件20、驱动组件50和检测组件60电性连接的处理器31及存储在存储器30上并可在处理器31上运行的计算机程序,处理器31以用于执行滑动组件的滑动控制方法,即,处理器31用于执行:获取所述第一霍尔元件62发送的第一中断信号,所述第一中断信号是所述第一霍尔元件62监测到输出的检测信号值大于预设的校准信号值后发送的;根据预设的与所述第一中断信号对应的第一延时开始计时,当到达所述第一延时后,获取所述第一霍尔元件62当前输出的第一检测信号值;若比较获知所述第一检测信号值小于所述校准信号值,则将所述滑动组件20从手动运行切换到自动运行,启动所述驱动组件50控制所述滑动组件从所述第一位置滑出到第二位置。
其中,需要说明的是,关于滑动组件的滑动控制方法的描述参看后续方法实施例中的相关描述,本实施例中对此不再赘述。
请参阅图1,在某些实施方式中,电子装置100可以包括相机42,滑动组件20包括承载件22,相机42设置在承载件22上。如此,相机42可以随着滑动组件20滑动。当然,可以将用户打开相机42和关闭相机42作为触发信号,也即是说,当用户打开相机42时,触发滑动组件20滑出,当用户关闭相机42时,触发滑动组件20滑回。如此 用户只需依照现有的习惯打开或关闭相机,而无需针对滑动组件20进行另外的操作,可以方便用户的使用。
除相机42之外,承载件22上也可以承载其他的电子元件,比如为光线传感器、接近传感器和听筒44等,如图1所示。其中,需要理解的是,相机42可以根据用户的输入随着滑动组件20的滑出而从本体10露出从而正常工作,也可以根据用户的输入随着滑动组件20的滑回而收容在本体10内。如此,可以尽量少地在显示组件(图中未示出)上设置通孔,有利于满足电子装置100全面屏的设计需求。
在某些实施例中,本体10形成有滑槽16,滑动组件20在第二位置B时处于滑槽16内。如此,可以使得滑动组件20通过滑槽16在第一位置A和第二位置B之间滑动。
请参阅图5,在某些实施方式中,滑动组件20包括设置在承载件22中部的螺纹孔24和与螺纹孔24配合的转动丝杆26。滑槽16包括与螺纹孔24相对设置且位于滑槽16底部的凹槽162。电子装置100包括设置在凹槽162的驱动组件50。驱动组件50包括与处理器31连接的驱动电机52和与转动丝杆26的底部连接的输出轴(图未示)。
可以理解,处理器31可以通过控制驱动电机52来控制滑动组件20的滑动。当用户命令滑动组件20从第一位置A向第二位置B滑动时,处理器31控制驱动电机52正转,从而使得输出轴带动转动丝杆26在螺纹孔24内转动,进而使得滑动组件20从第一位置A向第二位置B滑动。当用户命令滑动组件20从第二位置B向第一位置A滑动时,处理器31控制驱动电机52反转,从而使得输出轴带动转动丝杆26在螺纹孔24内转动,进而使得滑动组件20从第二位置B向第一位置A滑动。值得注意的是,此处的“从第一位置A向第二位置B”和“从第二位置B向第一位置A”是指滑动的方向,而不是指滑动的起点和终点。
在本申请实施例中,可以通过多种方式,确定滑动组件20相对于本体10的位置。
方式一
可以通过磁体和磁场探测器,确定滑动组件20相对于本体10的当前相对位置。需要说明的是,磁场探测器的数量可以为1个,也可以为多个,本申请实施例以磁场探测器的数量为1个进行说明。
其中,需要说明的是,图3示意出了磁场产生元件61设置于滑动组件20,第一霍尔元件62以及第二霍尔元件63设置在本体上的机构示意图。
在本申请实施例中,主要是基于霍尔元件的特性,即霍尔元件可以感应磁场产生元件61产生的磁场,并根据感应到的磁感应强度输出相应的信号,来确定滑动组件20相对于本体10的当前相对位置。由于磁感应强度与相对磁场产生元件61的当前相对位置相关,所以可以通过霍尔元件输出的检测信号值,确定霍尔元件与磁场产生元件61的相对位置。另外,由于磁场产生元件61设置在滑动组件20上,而霍尔元件固定设置在本体10上,磁场产生元件61和霍尔元件可以随着滑动组件20的运动产生相对运动,因而,可以通过确定霍尔元件与磁场产生元件61的相对位置间接的确定滑动组件20相对于本体10的相对位置。
其中,需要理解的是,通过本申请实施例的第一霍尔元件62和/或第二霍尔元件即 可确定出滑动组件20相对于本体10的相对位置。
具体实现时,可以预先将滑动组件20滑动到多个标定相对位置,并获取霍尔元件对应每个标定相对位置输出的检测信号值,并将其作为对应标定相对位置的预设信号值,然后将多个预设信号值和多个标定相对位置关联成查询表或者拟合成关系曲线,查询表或关系曲线中,包括多个预设信号值和多个标定相对位置,每个预设信号值与一个标定相对位置对应。从而在处理器31接收到霍尔元件输出的检测信号值后,可以根据霍尔元件的检测信号值,查询预先生成的查询表或关系曲线,从而确定反向推导出滑动组件20相对于本体10的当前相对位置。
方式二
可以通过距离传感器,确定滑动组件20相对于本体10的当前相对位置。其中,距离传感器可以是红外距离传感器、超声波位移传感器等任意可以进行距离检测的传感器。
参见图4,滑动组件20设置有距离传感器70,距离传感器70为至少两个,至少两个距离传感器70之间的连线与滑动组件20的滑动方向不垂直;距离传感器70与处理器31电性连接;处理器31,还用于接收至少两个距离传感器70的检测信号值;根据至少两个检测信号值确定滑动组件20相对于本体10的当前相对位置。
需要说明的是,图4以滑动组件20设置有第一距离传感器71和第二距离传感器72,且第一距离传感器71和第二距离传感器72之间的连线与滑动组件20的滑动方向平行为例进行示意。
下面以第一距离传感器71和第二距离传感器72为红外距离传感器为例,对本申请实施例中,处理器31确定滑动组件20相对于本体10的当前响度位置的过程进行说明。
在本申请实施例中,主要是基于第一距离传感器71和第二距离传感器72具备测距功能的特性,来确定滑动组件20相对于本体10的当前相对位置。红外距离传感器包括红外线发射管与红外线接收管,当发射管发出的红外线被接收管接收的时间较短时,表明距离较近;当接收管接收发射管发射的红外线时间较长时,表明距离较远。在本申请的实施方式中,所测的距离为第一距离传感器71和第二距离传感器72与本体10之间的相对距离。
根据感应到的第一距离传感器71和第二距离传感器72测距时间的总和来确定第一距离传感器71和第二距离传感器72相对于本体10的距离。由于时间长短与相对第一距离传感器71和第二距离传感器72的位置相关,而时间的长短与距离的长短有关,滑动组件20滑出的距离越长则接收时间越长,通过比对时间长短可判定滑动组件20位于第一位置A、第二位置B还是第一位置A和第二位置B之间。所以可以通过第一距离传感器71和第二距离传感器72输出的信号,确定第一距离传感器71和第二距离传感器72相对于本体10的当前相对位置。
另外,由于第一距离传感器71和第二距离传感器72分别固定在滑动组件20上,第一距离传感器71和第二距离传感器72可以随着滑动组件20的运动产生相对运动,因而,可以通过确定第二距离传感器72与第一距离传感器71的相对于本体10的位置, 间接地确定滑动组件20相对于本体10的当前相对位置。
具体实现时,可以预先将滑动组件20滑动到多个标定相对位置,并获取第一距离传感器71和第二距离传感器72对应每个标定相对位置输出的检测信号值,并将其作为对应标定位置的预设信号值,然后将多个预设信号值和多个标定位置关联成查询表或者拟合成关系曲线,查询表或关系曲线中,包括多个预设信号值和多个标定相对位置,每个预设信号值与一个标定相对位置对应。从而在处理器31接收到第一距离传感器71和第二距离传感器72输出的检测信号值后,可以根据检测信号值,查询预先生成的查询表或关系曲线,从而确定反向推导出滑动组件20相对于本体10的当前相对位置。
基于图1-图5中电子装置100的结构,下面对本申请实施例的滑动组件的滑动控制方法以及装置进行说明。
基于图1-图5所示,可知,该实施例的电子装置100包括本体10、滑动组件20、驱动组件50和检测组60,驱动组件50用于控制滑动组件20在收容于本体10的第一位置和自本体10露出的第二位置之间滑动,检测组件60包括磁场产生元件61、第一霍尔元件62和第二霍尔元件63,磁场产生元件61固定在滑动组件20上,第一霍尔元件62和第二霍尔元件63固定在本体10上,第一霍尔元件62设置在第二霍尔元件63的下方。
图6是根据本申请一个实施例的滑动组件的滑动控制方法的流程示意图。
如图6所示,该滑动控制方法包括以下步骤:
步骤601,获取第一霍尔元件发送的第一中断信号。
其中,第一中断信号是第一霍尔元件监测到输出的检测信号值大于预设的校准信号值后发送的。
作为一种示例性的实施方式,在电子装置使用的过程中,电子装置中的第一霍尔元件根据感应到的磁感应强度确定对应的检测信号值。在第一霍尔元件检测到输出的检测信号值大于预设的校准信号值后,第一霍尔元件发送第一中断信号。
步骤602,根据预设的与第一中断信号对应的第一延时开始计时,当到达第一延时后,获取第一霍尔元件当前输出的第一检测信号值。
具体地,在接收到第一霍尔元件发送的第一中断信号后,为了避免因第一霍尔元件受到其他磁场干扰,造成误判情况的发生,根据第一中断信号和预存的中断信号与延时之间的对应关系,获取与第一中断信号对应的第一延时,并根据第一延时开始计时,并在检测到到达第一延时后,读取第一霍尔元件当前输出的第一检测信号值。
其中,第一延时是电子装置中默认设置的,或者是用户根据需求预先在电子装置中预先设置的,例如,第一延时可以为10毫秒。
步骤603,若比较获知第一检测信号值小于校准信号值,则将滑动组件从手动运行切换到自动运行,启动驱动组件控制滑动组件从第一位置滑出到第二位置。
为了确定是否由电子装置自动完成后续滑动组件的滑出,减少用户对滑动组件进行另外操作的麻烦,以方便用户的使用。在获取第一霍尔元件当前输出的第一检测信号值后,可将第一检测信号值与校准信号值进行比较,如果比较获知第一检测信号值小于校准信号值,则将滑动组件从手动运行切换到自动运行,启动驱动组件控制滑动组件从第一位置滑出到第二 位置。由此,智能控制滑动组件从第一位置滑出到第二位置,而无需用户进行其它操作,方便用户的使用。
其中,需要说明的是,如果比较获知第一检测信号值小于校准信号值,则说明滑动组件正在远离校准点。
其中,需要说明的是,如果比较获知第一检测信号值超过校准信号值,则说明第一霍尔元件可能是由于受到周围其他磁场产生物体的影响,而造成当前输出的第一检测信号值超过校准信号值。为了避免误判,在比较获知第一检测信号值超过校准信号值时,可控制滑动组件手动运行到自动运行的切换功能关闭。
综上可以看出,该实施例的滑动组件的滑动控制方法,为了避免霍尔元件因受到其他磁场的影响,而导致误将滑动组件的手动运行切换到自动运行,造成误判,进而控制滑动组件滑入以及滑出,对滑动组件造成损耗以及对电子装置造成功耗。在接收到第一霍尔元件的中断信号后,根据预设的与第一中断信号对应的第一延时开始计时,当到达第一延时后,获取第一霍尔元件当前输出的第一检测信号值,并在第一检测信号值小于校准信号值时,将滑动组件从手动运行切换到自动运行,启动驱动组件控制滑动组件从第一位置滑出到第二位置。
本申请实施例的滑动组件的滑动控制方法,接收第一霍尔元件的中断信号,并在延时第一延时后,获取第一霍尔元件当前输出的第一检测信号值,并比较第一检测信号值与预设的校准信号值的大小,并在第一检测信号值小于预设的校准信号值时,将滑动组件从手动运行切换到自动运行,启动驱动组件控制滑动组件从第一位置滑出到第二位置。由此,在避免因霍尔元件受到其他磁场干扰,造成误判的情况发生的同时,智能控制滑动组件从第一位置滑出到第二位置,而无需用户进行其它操作,方便用户的使用。
基于上述实施例的基础上,在滑动组件从第一位置向第二位置滑动的过程中,由于滑动过程中会经过第二霍尔元件的校准点位置,此时,可接收到第二霍尔元件发送的第二中断信号,根据预设的与第二中断信号对应的第二延时开始计时,当到达第二延时后,由于滑动组件逐渐靠近第二霍尔元件,比较可获知第二霍尔元件当前输出的第二检测信号值大于校准信号值,此时,不满足滑入从手动运行切换到自动运行的条件,而满足滑出从手动运行切换到自动运行的条件,驱动组件控制滑动组件从第一位置滑出到第二位置。
基于上实施例的基础上,在实际应用过程中,在电子装置的滑动组件处于第二位置时,为了避免霍尔元件因受到其他磁场的影响,而导致误将滑动组件的手动运行切换到自动运行,造成误判,进而导致驱动组件控制滑动组件滑入,对滑动组件造成损耗以及对电子装置造成功耗,作为一种示例性的实施方式,在图6所示的基础上,如图7所示,该方法还可以包括:
步骤701,获取第二霍尔元件发送的第二中断信号。
其中,第二中断信号是第二霍尔元件监测到输出的检测信号值大于预设的校准信号值后发送的。
作为一种示例性的实施方式,在电子装置使用的过程中,电子装置中的第二霍尔元件根据感应到的磁感应强度确定对应的检测信号值。在第二霍尔元件检测到输出的检测信号值大于预设的校准信号值后,第二霍尔元件发送第二中断信号。
步骤702,根据预设的与第二中断信号对应的第二延时开始计时,当到达第二延时后,获取第二霍尔元件当前输出的第二检测信号值。
具体地,在接收到第二霍尔元件发送的第二中断信号后,为了避免因第二霍尔元件受到其他磁场干扰,造成误判情况的发生,根据第二中断信号和预存的中断信号与延时之间的对应关系,获取与第二中断信号对应的第二延时,并根据第二延时开始计时,并在检测到到达第二延时后,读取第二霍尔元件当前输出的第二检测信号值。
步骤703,若比较获知第二检测信号值小于校准信号值,则将滑动组件从手动运行切换到自动运行,启动驱动组件控制滑动组件从第二位置滑入到第一位置。
为了确定是否由电子装置自动完成后续滑动组件的滑入,减少用户对滑动组件进行另外操作的麻烦,以方便用户的使用。在获取第二霍尔元件当前输出的第二检测信号值后,可将第二检测信号值与校准信号值进行比较,如果比较获知第二检测信号值小于校准信号值,则将滑动组件从手动运行切换到自动运行,启动驱动组件控制滑动组件从第二位置滑入到第一位置。由此,智能控制滑动组件从第二位置滑出到第二位置,而无需用户进行其它操作,方便用户的使用。
其中,需要说明的是,如果比较获知第二检测信号值小于校准信号值,则说明滑动组件正在远离校准点。
其中,需要说明的是,如果比较获知第二检测信号值超过校准信号值,则说明第二霍尔元件可能是由于受到周围其他磁场产生物体的影响,而造成当前输出的第二检测信号值超过校准信号值。为了避免误判,在比较获知第二检测信号值超过校准信号值时,可控制滑动组件手动运行到自动运行的切换功能关闭。
综上可以看出,本申请实施例的滑动组件的滑动控制方法,为了避免霍尔元件因受到其他磁场的影响,而导致误将滑动组件的手动运行切换到自动运行,造成误判,进而控制滑动组件滑入以及滑出,对滑动组件造成损耗以及对电子装置造成功耗,在接收到第二霍尔元件的中断信号后,根据预设的与第二中断信号对应的第二延时开始计时,当到达第二延时后,获取第二霍尔元件当前输出的第二检测信号值,并在第二检测信号值小于校准信号值时,将滑动组件从手动运行切换到自动运行,启动驱动组件控制滑动组件从第二位置滑入到第一位置。由此,在避免因霍尔元件受到其他磁场干扰,造成误判的情况发生的同时,智能控制滑动组件从第二位置滑入到第一位置,而无需用户进行其它操作,方便用户的使用。
其中,需要理解的是,在因周围磁体产生的磁场较强时,有可能会出现第一霍尔元件以及第二霍尔元件所输出的检测信号值均大于各自对应的校准信号值的情况,此时,在获取到第一霍尔元件以及第二霍尔元件发送的中断信息后,可分别获取与第一中断信号对应的第一延时开始计时,并当到达第一延时后,获取第一霍尔元件当前输出的第一检测信号值,以及当到达第二延时后,获取第二霍尔元件当前输出的第二次检测信号值。如果比较第一检测信号值以及第二检测信号值均大于各自对应的校准信号值,由于不满足开启滑动组件手动运行到自动运行的切换功能的条件,此时,滑动组件手动运行到自动运行的切换功能继续处于关闭状态,从而避免了滑动组件的反复滑入以及滑出,减少了对滑动组件的损耗。
基于上述任意实施例的基础上,为了满足用户个性化设置滑动组件的滑出和/或滑入的 校准信号值的需求,如图8所示,该方法还可以包括:
步骤801,提供控制界面,获取用户根据需求在控制界面设置的校准信号值。
作为一种示例性的实施方式,为了方便用户设置滑动组件滑出和/或滑入对应的校准信号值,在用户进入控制界面后,可关闭滑动组件的手动运行到自动运行的切换功能,并提示用户在控制界面中设置滑动组件滑出和/或滑入对应的校准信号值。
其中,需要说明的是,滑动组件滑出与滑入时对应的校准信号值可以相同,也可以不同。
作为一种示例,在滑动组件处于第一位置,可提示用户手动将滑动组件滑动到一个期望的校准位置,在用户将滑动组件从第一位置滑动到校准位置时,获取第一霍尔元件当前输出的检测信号值,并将当前输出的检测信号值作为滑动组件滑出时对应的校准信号值,并在接收到用户的确认指令后,将校准信号值保存到处理器的reserve分区,并通过系统接口将校准信号值保存到第一霍尔元件的硬件寄存器中。由此,使得用户通过控制界面个性化设置的滑动组件滑出时对应的校准信号值,满足了用户个性化设置校准信号值的需求。
作为一种示例,在滑动组件处于第二位置,可提示用户将滑动组件从第二位置滑入到一个期望的校准位置,在用户将滑动组件从第二位置滑动到校准位置时,获取第二霍尔元件当前输出的检测信号值,并将当前输出的检测信号值作为滑动组件滑出时对应的校准信号值,并在接收到用户的确认指令后,将校准信号值保存到处理器的reserve分区,并通过系统接口将校准信号值保存到第二霍尔元件的硬件寄存器中。由此,使得用户通过控制界面个性化设置的滑动组件滑入时对应的校准信号值,满足了用户个性化设置校准信号值的需求
步骤802,当检测到电子装置启动后,向第一霍尔元件和第二霍尔元件的硬件寄存器中写入校准信号值。
其中,需要说明的是,为了避免刷机时校准信号值不被清除,作为一种示例性的实施方式,可将对应的校准信号值保存到处理器的reserve分区中。
在检测到电子装置启动后,可调用相应接口,将reserve分区存储的对应的校准信号值,对应写入第一霍尔元件和第二霍尔元件的硬件寄存器中。由此,将用户设置的校准信号值写入到第一霍尔元件和第二霍尔元件的硬件寄存器中,以方便后续霍尔元件基于当前输出的检测信号值和校准信号值确定是否发送中断信号。
在本申请的一个实施例中,为了提高电子装置的智能化,避免电子装置在使用过程中,因受到其他能够产生磁场的物体的影响,而引起霍尔元件的中断信号,自动控制电子装置的滑动组件滑入或者滑出情况的发生,避免了对滑动组件的损耗。基于上述任意一个实施例的基础上,如图9所示,该方法还可以包括:
步骤901,通过接近传感器监测电子装置是否满足预设的接近事件。
步骤902,若监测到电子装置满足预设的接近事件,则在底层驱动节点写入第一状态,指示关闭滑动组件手动运行到自动运行的切换功能。
步骤903,若监测到电子装置不满足预设的接近事件,则在底层驱动节点写入第二状态,指示开启滑动组件手动运行到自动运行的切换功能。
作为一种示例,在监测到接近传感器上报的事件为远离事件时,可检测到电子装置不满足预设的接近事件,此时,可在底层驱动节点写入第二状态,指示开启滑动组件手动运行到 自动运行的切换功能。
在本示例中,通过接近传感器监测电子装置是否满足预设的接近事件,并在监测到电子装置满足预设的接近事件时,在底层驱动节点写入第一状态,指示关闭滑动组件手动运行到自动运行的切换功能,由此,可避免电子装置在使用过程中,因受到其他能够产生磁场的物体的影响,而根据霍尔元件的中断信号,自动控制电子装置的滑动组件滑入或者滑出情况的发生,避免了对滑动组件的损耗。
并且,在监测到电子装置不满足预设的接近事件,则在底层驱动节点写入第二状态,指示开启滑动组件手动运行到自动运行的切换功能,由此,使得电子装置在后续使用过程中,在霍尔元件输出的检测信号值满足要求时,通过驱动组件自动完成滑动组件的滑入以及滑出,而无需用户对滑动组件进行另外操作,方便了用户的使用。
其中,需要说明的是,在实际应用中,在电子装置处于亮屏状态下,有时用户的身体部位例如手可能会靠近电子设备,此时,电子装置中的接近传感器检测到接近事件,并上报接近事件,此时,如果根据上报的接近事件,关闭滑动组件手动运行到自动运行的切换功能,电子装置自动完成滑动组件的滑入以及滑出,用户在使用电子设备的过程中,用户需要对滑动组件进行另外的操作,例如,用户手动将滑动组件滑入以及滑出,从而导致电子装置的用户体验不理想。
作为一种示例性的实施方式,为了方便用户使用电子设备,在图9所示的基础上,如图10所示,该方法还可以包括:
步骤101,监测电子装置的屏幕状态。
步骤102,若监测到电子装置处于亮屏状态,则对底层驱动节点写入的第二状态进行加锁处理,禁止在电子装置满足预设的接近事件时对第二状态进行状态修改。
步骤103,若监测到电子装置处于灭屏状态,则对底层驱动节点写入的第二状态进行解锁处理,允许在电子装置满足预设的接近事件时将第二状态修改为第一状态。
在本示例中,在监测到电子装置处于亮屏状态时,通过对对底层驱动节点写入的第二状态进行加锁处理,从而使得电子装置开启滑动组件手动运行到自动运行的切换功能,由此,方便后续在电子装置使用过程中,在霍尔元件输出的检测信号值满足要求时,通过驱动组件控制滑动组件的滑入以及滑出,从而无需用户对滑动组件进行另外的操作,方便了用户使用。
并且,在监测到电子装置处于灭屏状态时,通过对对底层驱动节点写入的第二状态进行解锁处理,从而允许在电子装置满足预设的接近事件时将第二状态修改为第一状态,由此,可避免电子设备处于灭屏状态时,因受到其他产生磁场的物体而导致滑动组件手动运行切换到自动运行,进而导致滑动组件反复滑出以及滑入情况的发生,减少对滑动组件的损耗,减少电子装置的功耗,改善了用户体验。
例如,在将处于灭屏状态的电子装置放在背包的过程中,假设背包中有另一个能够产生磁场的物体比如另一个手机,此时,电子装置中的霍尔元件可感应到磁感应强度输出相应的检测信号值,如果霍尔元件监测到输出的检测信号值大于预设的校准信号,则霍尔元件发送中断信号,在接收到中断信号后,获取与中断信号对应的延时,并在延迟对应时间后,获取霍尔元件当前输出的检测信号值。此时,即使通过比较获知当前输出的检测信号值小于预设 的校准信号值,电子装置中的滑动组件也不能从手动运行切换到自动运行。这是因为电子装置处于灭屏状态时,电子装置中的滑动组件手动运行到自动运行的切换功能处于关闭状态。由此,可以避免在电子装置在背包过程中,因受到磁场干扰,电子装置也将滑动组件从手动运行切换到自动运行,造成对滑动组件产生影响。
图11是根据本申请一个实施例的滑动组件的滑动控制装置的结构示意图。
其中,需要说明的是,该电子装置100包括本体10、滑动组件20、驱动组件50和检测组60,驱动组件50用于控制滑动组件20在收容于本体10的第一位置和自本体10露出的第二位置之间滑动,检测组件60包括磁场产生元件61、第一霍尔元件62和第二霍尔元件63,磁场产生元件61固定在滑动组件20上,第一霍尔元件62和第二霍尔元件63固定在本体10上,第一霍尔元件62设置在第二霍尔元件63的下方,如图10所示,该滑动控制装置80可以包括第一获取模块110、第二获取模块120和第一控制模块130,其中:
第一获取模块110,用于获取第一霍尔元件发送的第一中断信号,第一中断信号是第一霍尔元件监测到输出的检测信号值大于预设的校准信号值后发送的。
第二获取模块120,用于根据预设的与第一中断信号对应的第一延时开始计时,当到达第一延时后,获取第一霍尔元件当前输出的第一检测信号值。
第一控制模块130,用于在比较获知第一检测信号值小于校准信号值时,将滑动组件从手动运行切换到自动运行,启动驱动组件控制滑动组件从第一位置滑出到第二位置。
在本申请的一个实施例中,在图11所示的基础上,如图12所示,该装置还可以包括:
第三获取模块140,用于获取第二霍尔元件发送的第二中断信号,第二中断信号是第二霍尔元件监测到输出的检测信号值大于预设的校准信号值后发送的。
第四获取模块150,用于根据预设的与第二中断信号对应的第二延时开始计时,当到达第二延时后,获取第二霍尔元件当前输出的第二检测信号值。
第二控制模块160,用于在比较获知第二检测信号值小于校准信号值时,将滑动组件从手动运行切换到自动运行,启动驱动组件控制滑动组件从第二位置滑入到第一位置。
在本示例中,为了避免霍尔元件因受到其他磁场的影响,而导致误将滑动组件的手动运行切换到自动运行,造成误判,进而控制滑动组件滑入以及滑出,对滑动组件造成损耗以及对电子装置造成功耗。在接收到第二霍尔元件的中断信号后,根据预设的与第二中断信号对应的第二延时开始计时,当到达第二延时后,获取第二霍尔元件当前输出的第二检测信号值,并在第二检测信号值小于校准信号值时,将滑动组件从手动运行切换到自动运行,启动驱动组件控制滑动组件从第二位置滑入到第一位置。
在本申请的一个实施例中,为了满足用户个性化设置滑动组件滑入和/或滑出的校准信号值的需求,在图11所示的基础上,如图13所示,该装置还可以包括:
提供模块170,用于提供控制界面,获取用户根据需求在控制界面设置的校准信号值。
发送模块180,用于当检测到电子装置启动后,向第一霍尔元件和第二霍尔元件的硬件寄存器中写入校准信号值。
作为一种示例,在滑动组件处于第一位置,可提示用户手动将滑动组件滑动到一个期望的校准位置,在用户将滑动组件从第一位置滑动到校准位置时,获取第一霍尔元件当前输出 的检测信号值,并将当前输出的检测信号值作为滑动组件滑出时对应的校准信号值,并在接收到用户的确认指令后,将校准信号值保存到处理器的reserve分区,并通过系统接口将校准信号值保存到第一霍尔元件的硬件寄存器中。
作为一种示例,在滑动组件处于第二位置,可提示用户将滑动组件从第二位置滑入到一个期望的校准位置,在用户将滑动组件从第二位置滑动到校准位置时,获取第二霍尔元件当前输出的检测信号值,并将当前输出的检测信号值作为滑动组件滑出时对应的校准信号值,并在接收到用户的确认指令后,将校准信号值保存到处理器的reserve分区,并通过系统接口将校准信号值保存到第二霍尔元件的硬件寄存器中。
其中,需要说明的是,上述图13中的装置实施例中的提供模块170和发送模块180的结构也可以包含在上述图12所示的装置实施例中,该实施例对此不作限定。
在本申请一个实施例中,在图11所示的基础上,如图14所示,该装置还可以包括:
判断模块190,用于通过接近传感器监测电子装置是否满足预设的接近事件。
第三处理模块200,用于监测到电子装置满足预设的接近事件时,在底层驱动节点写入第一状态,指示关闭滑动组件手动运行到自动运行的切换功能。
第四处理模块210,用于在监测到电子装置不满足预设的接近事件时,在底层驱动节点写入第二状态,指示开启滑动组件手动运行到自动运行的切换功能。
在本示例中,通过接近传感器监测电子装置是否满足预设的接近事件,并在监测到电子装置满足预设的接近事件时,在底层驱动节点写入第一状态,指示关闭滑动组件手动运行到自动运行的切换功能,由此,可避免电子装置在使用过程中,因受到其他能够产生磁场的物体的影响,而根据霍尔元件的中断信号,自动控制电子装置的滑动组件滑入或者滑出情况的发生,避免了对滑动组件的损耗。
并且,在监测到电子装置不满足预设的接近事件,则在底层驱动节点写入第二状态,指示开启滑动组件手动运行到自动运行的切换功能,由此,使得电子装置后续可自动完成滑动组件的滑入以及滑出,而无需用户对滑动组件进行另外操作,方便了用户的使用。
在本申请的一个实施例中,如图14所示,该装置还可以包括:
监测模块220,用于监测电子装置的屏幕状态。
加锁模块230,用于在监测到电子装置处于亮屏状态时,对底层驱动节点写入的第二状态进行加锁处理,禁止在电子装置满足预设的接近事件时对第二状态进行状态修改。
解锁模块240,用于在监测到电子装置处于灭屏状态时,对底层驱动节点写入的第二状态进行解锁处理,允许在电子装置满足预设的接近事件时将第二状态修改为第一状态。
其中,需要说明的是,前述对电子装置以及滑动组件的滑动控制方法实施例的解释说明也适用于该实施例的滑动组件的滑动控制装置,此处不再赘述。
本申请实施例的滑动组件的滑动控制装置,接收第一霍尔元件的中断信号,并在延时第一延时后,获取第一霍尔元件当前输出的第一检测信号值,并比较第一检测信号值与预设的校准信号值的大小,并在第一检测信号值小于预设的校准信号值时,将滑动组件从手动运行切换到自动运行,启动驱动组件控制滑动组件从第一位置滑出到第二位置。由此,在避免因霍尔元件受到其他磁场干扰,造成误判的情况发生的同时,智能控制滑动组件从第一位置滑 出到第二位置,而无需用户进行其它操作,方便用户的使用。
为了实现上述实施例,本申请还提出一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现上述实施例的滑动组件的滑动控制方法。
为了实现上述实施例,本申请还提出一种计算机程序产品,当计算机程序产品中的指令由处理器执行时,执行上述实施例的滑动组件的滑动控制方法。
在本说明书的描述中,参考术语“一个实施方式”、“某些实施方式”、“示意性实施方式”、“示例”、“具体示例”、或“一些示例”等的描述意指结合实施方式或示例描述的具体特征、结构、材料或者特点包含于本申请的至少一个实施方式或示例中。在本说明书中,对上述术语的示意性表述不一定指的是相同的实施方式或示例。而且,描述的具体特征、结构、材料或者特点可以在任何的一个或多个实施方式或示例中以合适的方式结合。
尽管已经示出和描述了本申请的实施方式,本领域的普通技术人员可以理解:在不脱离本申请的原理和宗旨的情况下可以对这些实施方式进行多种变化、修改、替换和变型,本申请的范围由权利要求及其等同物限定。
Claims (12)
- 一种滑动组件的滑动控制方法,其特征在于,所述滑动组件用于电子装置,所述电子装置包括本体、检测组件和驱动组件,所述驱动组件用于控制所述滑动组件在收容于所述本体的第一位置和自所述本体露出的第二位置之间滑动,所述检测组件包括磁场产生元件、第一霍尔元件和第二霍尔元件,所述磁场产生元件固定在所述滑动组件,所述第一霍尔元件和所述第二霍尔元件固定在所述本体上,所述第一霍尔元件设置在所述第二霍尔元件的下方,所述滑动控制方法包括以下步骤:获取所述第一霍尔元件发送的第一中断信号,所述第一中断信号是所述第一霍尔元件监测到输出的检测信号值大于预设的校准信号值后发送的;根据预设的与所述第一中断信号对应的第一延时开始计时,当到达所述第一延时后,获取所述第一霍尔元件当前输出的第一检测信号值;若比较获知所述第一检测信号值小于所述校准信号值,则将所述滑动组件从手动运行切换到自动运行,启动所述驱动组件控制所述滑动组件从所述第一位置滑出到第二位置。
- 如权利要求1所述的方法,其特征在于,还包括:获取所述第二霍尔元件发送的第二中断信号,所述第二中断信号是所述第二霍尔元件监测到输出的检测信号值大于预设的校准信号值后发送的;根据预设的与所述第二中断信号对应的第二延时开始计时,当到达所述第二延时后,获取所述第二霍尔元件当前输出的第二检测信号值;若比较获知所述第二检测信号值小于所述校准信号值,则将所述滑动组件从手动运行切换到自动运行,启动所述驱动组件控制所述滑动组件从所述第二位置滑入到所述第一位置。
- 如权利要求1或2任一项所述的方法,其特征在于,还包括:提供控制界面,获取用户根据需求在所述控制界面设置的所述校准信号值;当检测到所述电子装置启动后,向所述第一霍尔元件和所述第二霍尔元件的硬件寄存器中写入所述校准信号值。
- 如权利要求1-3任一项所述的方法,其特征在于,还包括:通过接近传感器监测所述电子装置是否满足预设的接近事件;若监测到所述电子装置满足预设的接近事件,则在底层驱动节点写入第一状态,指示关闭所述滑动组件手动运行到自动运行的切换功能;若监测到所述电子装置不满足预设的接近事件,则在底层驱动节点写入第二状态,指示开启所述滑动组件手动运行到自动运行的切换功能。
- 如权利要求4所述的方法,其特征在于,还包括:监测所述电子装置的屏幕状态;若监测到所述电子装置处于亮屏状态,则对所述底层驱动节点写入的第二状态进行加锁处理,禁止在所述电子装置满足预设的接近事件时对所述第二状态进行状态修改;若监测到所述电子装置处于灭屏状态,则对所述底层驱动节点写入的第二状态进行解锁处理,允许在所述电子装置满足预设的接近事件时将所述第二状态修改为所述第一状态。
- 一种滑动组件的滑动控制装置,其特征在于,所述滑动组件用于电子装置,所述电子装置包括本体、检测组件和驱动组件,所述驱动组件用于控制所述滑动组件在收容于所述本体的第一位置和自所述本体露出的第二位置之间滑动,所述检测组件包括磁场产生元件、第一霍尔元件和第二霍尔元件,所述磁场产生元件固定在所述滑动组件,所述第一霍尔元件和所述第二霍尔元件固定在所述本体上,所述第一霍尔元件设置在所述第二霍尔元件的下方,所述滑动控制装置包括:第一获取模块,用于获取所述第一霍尔元件发送的第一中断信号,所述第一中断信号是所述第一霍尔元件监测到输出的检测信号值大于预设的校准信号值后发送的;第二获取模块,用于根据预设的与所述第一中断信号对应的第一延时开始计时,当到达所述第一延时后,获取所述第一霍尔元件当前输出的第一检测信号值;第一控制模块,用于在比较获知所述第一检测信号值小于所述校准信号值时,将所述滑动组件从手动运行切换到自动运行,启动所述驱动组件控制所述滑动组件从所述第一位置滑出到第二位置。
- 如权利要求6所述的装置,其特征在于,还包括:第三获取模块,用于获取所述第二霍尔元件发送的第二中断信号,所述第二中断信号是所述第二霍尔元件监测到输出的检测信号值大于预设的校准信号值后发送的;第四获取模块,用于根据预设的与所述第二中断信号对应的第二延时开始计时,当到达所述第二延时后,获取所述第二霍尔元件当前输出的第二检测信号值;第二控制模块,用于在比较获知所述第二检测信号值小于所述校准信号值时,将所述滑动组件从手动运行切换到自动运行,启动所述驱动组件控制所述滑动组件从所述第二位置滑入到所述第一位置。
- 如权利要求6或7所述的装置,其特征在于,还包括:提供模块,用于提供控制界面,获取用户根据需求在所述控制界面设置的所述校准信号值;发送模块,用于当检测到所述电子装置启动后,向所述第一霍尔元件和所述第二霍尔元件的硬件寄存器中写入所述校准信号值。
- 如权利要求6-8任一项所述的装置,其特征在于,还包括:判断模块,用于通过接近传感器监测所述电子装置是否满足预设的接近事件;第三处理模块,用于监测到所述电子装置满足预设的接近事件时,在底层驱动节点写入第一状态,指示关闭所述滑动组件手动运行到自动运行的切换功能;第四处理模块,用于在监测到所述电子装置不满足预设的接近事件时,在底层驱动节点写入第二状态,指示开启所述滑动组件手动运行到自动运行的切换功能。
- 如权利要求9所述的装置,其特征在于,还包括:监测模块,用于监测所述电子装置的屏幕状态;加锁模块,用于在监测到所述电子装置处于亮屏状态时,对所述底层驱动节点写入的第二状态进行加锁处理,禁止在所述电子装置满足预设的接近事件时对所述第二状态进行状态修改;解锁模块,用于在监测到所述电子装置处于灭屏状态时,对所述底层驱动节点写入的第二状态进行解锁处理,允许在所述电子装置满足预设的接近事件时将所述第二状态修改为所述第一状态。
- 一种电子装置,其特征在于,所述电子装置包括本体、滑动组件、检测组件和驱动组件,所述驱动组件用于控制所述滑动组件在收容于所述本体的第一位置和自所述本体露出的第二位置之间滑动,所述检测组件包括磁场产生元件、第一霍尔元件和第二霍尔元件,所述磁场产生元件固定在所述滑动组件,所述第一霍尔元件和所述第二霍尔元件固定在所述本体上,所述第一霍尔元件设置在所述第二霍尔元件的下方,所述电子装置还包括:存储器、与所述滑动组件、所述检测组件以及所述驱动组件电性连接的处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时,实现如权利要求1-5中任一所述的滑动组件的滑动控制方法。
- 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现如权利要求1-5中任一所述的滑动组件的滑动控制方法。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810860284.X | 2018-08-01 | ||
CN201810860284.XA CN109151106B (zh) | 2018-08-01 | 2018-08-01 | 滑动组件的滑动控制方法、装置、电子装置及存储介质 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2020024711A1 true WO2020024711A1 (zh) | 2020-02-06 |
Family
ID=64798481
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2019/091542 WO2020024711A1 (zh) | 2018-08-01 | 2019-06-17 | 滑动组件的滑动控制方法、装置、电子装置及存储介质 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN109151106B (zh) |
WO (1) | WO2020024711A1 (zh) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109151106B (zh) * | 2018-08-01 | 2020-06-19 | Oppo广东移动通信有限公司 | 滑动组件的滑动控制方法、装置、电子装置及存储介质 |
CN110650231A (zh) * | 2019-09-27 | 2020-01-03 | 维沃移动通信有限公司 | 电子设备及电子设备的控制方法 |
CN112328082B (zh) * | 2020-11-10 | 2022-12-20 | 昆山国显光电有限公司 | 滑移终端以及滑移终端位移检测的校对方法 |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7672700B2 (en) * | 2004-03-22 | 2010-03-02 | Kabushiki Kaisha Toshiba | Portable information terminal |
CN102957763A (zh) * | 2011-08-18 | 2013-03-06 | 希姆通信息技术(上海)有限公司 | 手机 |
CN107295190A (zh) * | 2017-07-10 | 2017-10-24 | 北京小米移动软件有限公司 | 工作模式切换方法、装置及保护套 |
CN108234700A (zh) * | 2018-01-08 | 2018-06-29 | 广州视源电子科技股份有限公司 | 电子设备 |
CN109151106A (zh) * | 2018-08-01 | 2019-01-04 | Oppo广东移动通信有限公司 | 滑动组件的滑动控制方法、装置、电子装置及存储介质 |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107291313B (zh) * | 2017-07-05 | 2020-10-02 | Oppo广东移动通信有限公司 | 一种指纹唤醒的控制方法、装置、存储介质及移动终端 |
-
2018
- 2018-08-01 CN CN201810860284.XA patent/CN109151106B/zh active Active
-
2019
- 2019-06-17 WO PCT/CN2019/091542 patent/WO2020024711A1/zh active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7672700B2 (en) * | 2004-03-22 | 2010-03-02 | Kabushiki Kaisha Toshiba | Portable information terminal |
CN102957763A (zh) * | 2011-08-18 | 2013-03-06 | 希姆通信息技术(上海)有限公司 | 手机 |
CN107295190A (zh) * | 2017-07-10 | 2017-10-24 | 北京小米移动软件有限公司 | 工作模式切换方法、装置及保护套 |
CN108234700A (zh) * | 2018-01-08 | 2018-06-29 | 广州视源电子科技股份有限公司 | 电子设备 |
CN109151106A (zh) * | 2018-08-01 | 2019-01-04 | Oppo广东移动通信有限公司 | 滑动组件的滑动控制方法、装置、电子装置及存储介质 |
Also Published As
Publication number | Publication date |
---|---|
CN109151106A (zh) | 2019-01-04 |
CN109151106B (zh) | 2020-06-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2020024711A1 (zh) | 滑动组件的滑动控制方法、装置、电子装置及存储介质 | |
KR101412448B1 (ko) | 디스플레이가 꺼져 있는 저전력 모드에서의 터치입력을 통한 디바이스 구동시스템 | |
EP3166036B1 (en) | Terminal having fingerprint identification function | |
US9462104B2 (en) | Method of using light sensor earphone to control electronic device and light sensor earphone | |
US11233671B2 (en) | Smart internet of things menus with cameras | |
US10694136B2 (en) | Method, apparatus and electronic device for interface invoking | |
WO2017152621A1 (zh) | 温度控制方法及装置 | |
WO2018107973A1 (zh) | 烹饪电器的控制方法和控制装置以及烹饪电器 | |
CN108897375B (zh) | 滑动机构的控制方法、装置、电子设备及存储介质 | |
US11173895B2 (en) | Parking support apparatus | |
US20130111379A1 (en) | Computing device and control method thereof | |
CN103516900A (zh) | 电子设备在系统休眠时启动前置后置摄像头的方法及装置 | |
WO2020024713A1 (zh) | 滑动组件的滑动控制方法、装置、电子装置及存储介质 | |
KR20160034846A (ko) | 백라이트 광도 제어 방법 및 디바이스 | |
US9018919B2 (en) | Battery detector for portable electronic device and method thereof | |
CN103248844A (zh) | 面板按键控制电视机的方法及电视机 | |
CN106933362A (zh) | 一种鼠标的控制方法、鼠标控制器和电子设备 | |
CN108989493B (zh) | 滑动机构的控制方法、控制组件、电子设备和存储介质 | |
CN104937852B (zh) | 用于对移动装置进行外部控制的方法和设备 | |
CN108924289B (zh) | 滑动机构的控制方法、装置、电子设备及存储介质 | |
US20160147282A1 (en) | Terminal Device and Method for Controlling Terminal Device | |
CN111770265A (zh) | 亮度调整方法、装置及相关设备 | |
KR100631628B1 (ko) | 이동 통신 단말기의 전원키 독립 백라이트 장치 및 방법 | |
CN109005280B (zh) | 滑动组件的手动转自动设置方法、装置及电子设备 | |
CN112702482B (zh) | 一种摄像头调节焦距的方法以及装置 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 19843907 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 19843907 Country of ref document: EP Kind code of ref document: A1 |