CN109151106B - Sliding control method and device for sliding assembly, electronic device and storage medium - Google Patents

Sliding control method and device for sliding assembly, electronic device and storage medium Download PDF

Info

Publication number
CN109151106B
CN109151106B CN201810860284.XA CN201810860284A CN109151106B CN 109151106 B CN109151106 B CN 109151106B CN 201810860284 A CN201810860284 A CN 201810860284A CN 109151106 B CN109151106 B CN 109151106B
Authority
CN
China
Prior art keywords
hall element
signal value
assembly
electronic device
sliding assembly
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.)
Active
Application number
CN201810860284.XA
Other languages
Chinese (zh)
Other versions
CN109151106A (en
Inventor
刘黎
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201810860284.XA priority Critical patent/CN109151106B/en
Publication of CN109151106A publication Critical patent/CN109151106A/en
Priority to PCT/CN2019/091542 priority patent/WO2020024711A1/en
Application granted granted Critical
Publication of CN109151106B publication Critical patent/CN109151106B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/02Constructional features of telephone sets
    • H04M1/0202Portable telephone sets, e.g. cordless phones, mobile phones or bar type handsets
    • H04M1/026Details of the structure or mounting of specific components
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B15/00Systems controlled by a computer
    • G05B15/02Systems controlled by a computer electric

Abstract

The invention discloses a sliding control method and device of a sliding assembly, an electronic device and a storage medium, wherein the method comprises the following steps: acquiring a first interrupt signal sent by a first Hall element, wherein the first interrupt signal is sent after the first Hall element monitors that the value of an output detection signal is larger than a preset calibration signal value; starting timing according to a preset first delay corresponding to the first interrupt signal, and acquiring a first detection signal value currently output by the first Hall element after the first delay is reached; and if the comparison result shows that the first detection signal value is smaller than the calibration signal value, switching the sliding assembly from manual operation to automatic operation, and starting the driving assembly to control the sliding assembly to slide out from the first position to the second position. Therefore, when the situation that misjudgment is caused due to the fact that the Hall element is interfered by other magnetic fields is avoided, the intelligent control sliding assembly slides out from the first position to the second position, other operations are not needed by a user, and the intelligent control sliding assembly is convenient for the user to use.

Description

Sliding control method and device for sliding assembly, electronic device and storage medium
Technical Field
The present invention relates to the field of electronic technologies, and in particular, to a method and an apparatus for controlling sliding of a sliding component, an electronic apparatus, and a storage medium.
Background
In order to improve the user experience, the screen occupation of electronic devices such as mobile terminals is increasing, and even the design of full screen has been proposed.
In the related art, in order to increase the screen occupation ratio, some electronic apparatuses hide electronic components originally provided on a front panel of the electronic apparatus by providing electronic devices on a slide assembly. Thus, how to control the sliding assembly becomes an urgent problem to be solved.
Disclosure of Invention
The invention provides a sliding control method and device of a sliding assembly, an electronic device and a storage medium.
The invention discloses a sliding control method of a sliding assembly, wherein a driving assembly is used for controlling the sliding assembly to slide between a first position accommodated in a body and a second position exposed out of the body, a detection assembly comprises a magnetic field generating element, a first Hall element and a second Hall element, the magnetic field generating element is fixed on the sliding assembly, the first Hall element and the second Hall element are fixed on the body, the first Hall element is arranged below the second Hall element, and the sliding control method comprises the following steps:
acquiring a first interrupt signal sent by the first Hall element, wherein the first interrupt signal is sent after the first Hall element monitors that the value of an output detection signal is larger than a preset calibration signal value;
starting timing according to a preset first delay corresponding to the first interrupt signal, and acquiring a first detection signal value currently output by the first Hall element after the first delay is reached;
and if the comparison shows that the first detection signal value is smaller than the calibration signal value, switching the sliding assembly from manual operation to automatic operation, and starting the driving assembly to control the sliding assembly to slide out from the first position to the second position.
The sliding control method of the sliding assembly receives an interrupt signal of the first Hall element, obtains a first detection signal value currently output by the first Hall element after delaying for a first delay, compares the first detection signal value with a preset calibration signal value, switches the sliding assembly from manual operation to automatic operation when the first detection signal value is smaller than the preset calibration signal value, and starts the driving assembly to control the sliding assembly to slide out from a first position to a second position. Therefore, when the situation that misjudgment is caused due to the fact that the Hall element is interfered by other magnetic fields is avoided, the intelligent control sliding assembly slides out from the first position to the second position, other operations are not needed by a user, and the intelligent control sliding assembly is convenient for the user to use.
The invention discloses a sliding control device of a sliding assembly, wherein the sliding assembly is used for an electronic device, the electronic device comprises a body, a detection assembly and a driving assembly, the driving assembly is used for controlling the sliding assembly to slide between a first position accommodated in the body and a second position exposed out of the body, the detection assembly comprises a magnetic field generating element, a first Hall element and a second Hall element, the magnetic field generating element is fixed on the sliding assembly, the first Hall element and the second Hall element are fixed on the body, the first Hall element is arranged below the second Hall element, and the sliding control device comprises:
the first acquisition module is used for acquiring a first interrupt signal sent by the first Hall element, wherein the first interrupt signal is sent after the first Hall element monitors that the output detection signal value is greater than a preset calibration signal value;
the second acquisition module is used for starting timing according to a preset first delay corresponding to the first interrupt signal, and acquiring a first detection signal value currently output by the first Hall element after the first delay is reached;
and the first control module is used for switching the sliding assembly from manual operation to automatic operation and starting the driving assembly to control the sliding assembly to slide out from the first position to the second position when the comparison result shows that the first detection signal value is smaller than the calibration signal value.
The sliding control device of the sliding assembly receives the interrupt signal of the first Hall element, obtains the first detection signal value currently output by the first Hall element after delaying the first delay, compares the first detection signal value with the preset calibration signal value, switches the sliding assembly from manual operation to automatic operation when the first detection signal value is smaller than the preset calibration signal value, and starts the driving assembly to control the sliding assembly to slide out from the first position to the second position. Therefore, when the situation that misjudgment is caused due to the fact that the Hall element is interfered by other magnetic fields is avoided, the intelligent control sliding assembly slides out from the first position to the second position, other operations are not needed by a user, and the intelligent control sliding assembly is convenient for the user to use.
The invention discloses an electronic device, which comprises a body, a sliding assembly, a detection assembly and a driving assembly, wherein the driving assembly is used for controlling the sliding assembly to slide between a first position accommodated in the body and a second position exposed out of the body, the detection assembly comprises a magnetic field generating element, a first Hall element and a second Hall element, the magnetic field generating element is fixed on the sliding assembly, the first Hall element and the second Hall element are fixed on the body, the first Hall element is arranged below the second Hall element, and the electronic device also comprises: the sliding control method of the sliding component comprises a memory, a processor electrically connected with the sliding component, the detection component and the driving component, and a computer program which is stored on the memory and can be run on the processor, wherein when the processor executes the program, the sliding control method of the sliding component of the embodiment is realized.
A computer-readable storage medium has stored thereon a computer program which, when executed by a processor, implements a slide control method of a slide module.
A computer program product is disclosed, in which instructions are executed by a processor to perform a slip control method for a slip assembly.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The above and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 is a schematic view of an electronic device in a second position according to an embodiment of the present invention;
FIG. 2 is a schematic view of an electronic device in a first position according to an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of an electronic device according to an embodiment of the invention;
FIG. 4 is a schematic view of another electronic device according to an embodiment of the invention;
FIG. 5 is a schematic view of another electronic device according to an embodiment of the invention;
FIG. 6 is a flow chart diagram of a slip control method of a slip assembly according to one embodiment of the present invention;
FIG. 7 is a flow chart diagram of a slip control method of a slip assembly according to another embodiment of the present invention;
FIG. 8 is a flow chart diagram of a slip control method of a slip assembly according to another embodiment of the present invention;
FIG. 9 is a schematic flow chart diagram of a slip control method of a slip assembly according to another embodiment of the present invention;
FIG. 10 is a schematic flow chart diagram of a slip control method of a slip assembly according to another embodiment of the present invention;
FIG. 11 is a schematic structural view of a slide control device of the slide assembly according to one embodiment of the present invention;
FIG. 12 is a schematic structural view of a slide control device of the slide assembly according to another embodiment of the present invention;
FIG. 13 is a schematic structural view of a slide control device of the slide assembly according to another embodiment of the present invention;
fig. 14 is a schematic structural view of a slide control device of a slide module according to another embodiment of the present invention.
Description of the main element symbols:
the electronic device 100, the body 10, the main board 12, the sliding slot 16, the groove 162, the sliding assembly 20, the carrier 22, the threaded hole 24, the rotary screw 26, the memory 30, the processor 31, the camera 42, the earpiece 44, the driving assembly 50, the driving motor 52, the detecting assembly 60, the magnetic field generating element 61, the first hall element 62, the second hall element 63, the distance sensor 70, the first distance sensor 71, the second distance sensor 72, the first position a, the second position B, the sliding control device 80, the first obtaining module 110, the second obtaining module 120, the first control module 130, the third obtaining module 140, the fourth obtaining module 150, the second control module 160, the providing module 170, the sending module 180, the judging module 190, the third processing module 200, the fourth processing module 210, the monitoring module 220, the locking module 230, and the unlocking module 240.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are illustrative only for the purpose of explaining the present invention, and are not to be construed as limiting the present invention.
In the description of the present invention, it is to be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", and the like, indicate orientations and positional relationships based on those shown in the drawings, and are used only for convenience of description and simplicity of description, and do not indicate or imply that the device or element being referred to must have a particular orientation, be constructed and operated in a particular orientation, and thus, should not be considered as limiting the present invention. Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, features defined as "first", "second", may explicitly or implicitly include one or more of the described features. In the description of the present invention, "a plurality" means two or more unless specifically defined otherwise.
In the description of the present invention, it should be noted that, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; may be mechanically connected, may be electrically connected or may be in communication with each other; either directly or indirectly through intervening media, either internally or in any other relationship. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.
In the present invention, unless otherwise expressly stated or limited, "above" or "below" a first feature means that the first and second features are in direct contact, or that the first and second features are not in direct contact but are in contact with each other via another feature therebetween. Also, the first feature being "on," "above" and "over" the second feature includes the first feature being directly on and obliquely above the second feature, or merely indicating that the first feature is at a higher level than the second feature. A first feature being "under," "below," and "beneath" a second feature includes the first feature being directly under and obliquely below the second feature, or simply meaning that the first feature is at a lesser elevation than the second feature.
The following disclosure provides many different embodiments or examples for implementing different features of the invention. To simplify the disclosure of the present invention, the components and arrangements of specific examples are described below. Of course, they are merely examples and are not intended to limit the present invention. Furthermore, the present invention may repeat reference numerals and/or letters in the various examples, such repetition is for the purpose of simplicity and clarity and does not in itself dictate a relationship between the various embodiments and/or configurations discussed. In addition, the present invention provides examples of various specific processes and materials, but one of ordinary skill in the art may recognize applications of other processes and/or uses of other materials.
First, the electronic device 100 according to the present invention will be described in detail with reference to fig. 1 to 5.
As shown in fig. 1 to 5, the electronic device 100 includes a body 10, a sliding assembly 20, a driving assembly 50 and a detecting assembly 60, wherein the driving assembly 50 is configured to control the sliding assembly 20 to slide between a first position a accommodated in the body 10 and a second position B exposed from the body 10, the detecting 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, the first hall element 62 and the second hall element 63 are fixed on the body 10, and the first hall element 62 is disposed below the second hall element 63, and the electronic device 100 may further include: the memory 30, the processor 31 electrically connected to the sliding assembly 20, the driving assembly 50 and the detecting assembly 60, and a computer program stored on the memory 30 and executable on the processor 31, the processor 31 is configured to execute the sliding control method of the sliding assembly, that is, the processor 31 is configured to execute: acquiring a first interrupt signal sent by the first hall element 62, wherein the first interrupt signal is sent after the first hall element 62 monitors that the output detection signal value is greater than a preset calibration signal value; starting timing according to a preset first delay corresponding to the first interrupt signal, and acquiring a first detection signal value currently output by the first hall element 62 after the first delay is reached; if the comparison result shows that the first detection signal value is smaller than the calibration signal value, the sliding assembly 20 is switched from the manual operation to the automatic operation, and the driving assembly 50 is started to control the sliding assembly to slide out from the first position to the second position.
It should be noted that, for the description of the sliding control method of the sliding assembly, reference is made to the related description in the following method embodiment, and details of this embodiment are not repeated.
Referring to fig. 1, in some embodiments, 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. In this manner, the camera 42 may slide with the slide assembly 20. Of course, the user may turn on the camera 42 and turn off the camera 42 as the trigger signal, that is, when the user turns on the camera 42, the trigger sliding assembly 20 slides out, and when the user turns off the camera 42, the trigger sliding assembly 20 slides back. Thus, the user can use the camera conveniently only by opening or closing the camera according to the existing habit without performing additional operation on the sliding assembly 20.
In addition to the camera 42, other electronic components may be carried on the carrier 22, such as a light sensor, a proximity sensor, and an earpiece 44, as shown in FIG. 1. It should be understood that the camera 42 may be exposed from the body 10 to work normally as the sliding assembly 20 slides out according to the input of the user, or may be accommodated in the body 10 as the sliding assembly 20 slides back according to the input of the user. Thus, through holes can be formed in the display assembly (not shown in the figure) as few as possible, which is beneficial to meeting the design requirement of the whole screen of the electronic device 100.
In some embodiments, the body 10 is formed with a slide channel 16, and the slide assembly 20 is disposed within the slide channel 16 in the second position B. In this manner, the sliding assembly 20 may be caused to slide between the first position a and the second position B via the sliding channel 16.
Referring to fig. 5, in some embodiments, the sliding assembly 20 includes a threaded bore 24 disposed in a central portion of the carrier 22 and a rotating lead screw 26 engaged with the threaded bore 24. The chute 16 includes a recess 162 located opposite the threaded aperture 24 and at the bottom of the chute 16. Electronic device 100 includes a drive assembly 50 disposed in recess 162. The drive assembly 50 includes a drive motor 52 connected to the processor 31 and an output shaft (not shown) connected to the bottom of the rotary screw 26.
It is understood that the processor 31 may control the sliding of the slide assembly 20 by controlling the drive motor 52. When the user commands the sliding assembly 20 to slide from the first position a to the second position B, the processor 31 controls the driving motor 52 to rotate forward, so that the output shaft drives the rotating screw 26 to rotate in the threaded hole 24, and the sliding assembly 20 slides from the first position a to the second position B. When the user commands the sliding assembly 20 to slide from the second position B to the first position a, the processor 31 controls the driving motor 52 to rotate in reverse, so that the output shaft drives the rotating screw 26 to rotate in the threaded hole 24, and the sliding assembly 20 slides from the second position B to the first position a. It is to be noted that "from the first position a to the second position B" and "from the second position B to the first position a" herein refer to the direction of the sliding, and do not refer to the start point and the end point of the sliding.
In embodiments of the present invention, the position of the sliding assembly 20 relative to the body 10 may be determined in a variety of ways.
In a first mode
The current relative position of the sliding assembly 20 with respect to the body 10 may be determined by a magnet and a magnetic field detector. It should be noted that the number of the magnetic field detectors may be 1, or may be plural, and the embodiment of the present invention is described with the number of the magnetic field detectors being 1.
Note that fig. 3 is a schematic diagram showing a mechanism in which the magnetic field generating element 61 is provided in the slider assembly 20, and the first hall element 62 and the second hall element 63 are provided in the main body.
In the embodiment of the present invention, the current relative position of the sliding assembly 20 with respect to the body 10 is determined based on the characteristics of the hall element, that is, the hall element can sense the magnetic field generated by the magnetic field generating element 61 and output a corresponding signal according to the sensed magnetic induction. Since the magnetic induction intensity is correlated with 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 from the hall element. In addition, since 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 movement with the movement of the sliding assembly 20, and thus, the relative position of the sliding assembly 20 with respect to the body 10 can be indirectly determined by determining the relative position of the hall element and the magnetic field generating element 61.
It should be understood that the relative position of the sliding assembly 20 with respect to the body 10 can be determined by the first hall element 62 and/or the second hall element according to the embodiment of the present invention.
In a specific implementation, the sliding assembly 20 may be slid to a plurality of calibration relative positions in advance, a detection signal value output by the hall element corresponding to each calibration relative position is obtained and is used as a preset signal value corresponding to the calibration relative position, and then the plurality of preset signal values and the plurality of calibration relative positions are associated to form a lookup table or fitted to form a relationship curve, where the lookup table or the relationship curve includes the plurality of preset signal values and the plurality of calibration relative positions, and each preset signal value corresponds to one calibration relative position. Therefore, after the processor 31 receives the detection signal value output by the hall element, the pre-generated lookup table or relationship curve can be queried according to the detection signal value of the hall element, so as to determine and reversely derive the current relative position of the sliding assembly 20 relative to the body 10.
Mode two
The current relative position of the slide assembly 20 with respect to the body 10 may be determined by a distance sensor. The distance sensor may be any sensor capable of detecting distance, such as an infrared distance sensor or an ultrasonic displacement sensor.
Referring to fig. 4, the sliding assembly 20 is provided with at least two distance sensors 70, and a connection line between the at least two distance sensors 70 is not perpendicular to the sliding direction of the sliding assembly 20; the distance sensor 70 is electrically connected with the processor 31; a processor 31, further configured to receive detection signal values of at least two distance sensors 70; the current relative position of the slide assembly 20 with respect to the body 10 is determined based on at least two detected signal values.
Fig. 4 illustrates an example in which the slide module 20 is provided with two distance sensors, i.e., a first distance sensor 71 and a second distance sensor 72, and a connection line between the first distance sensor 71 and the second distance sensor 72 is parallel to the sliding direction of the slide module 20.
The following describes a process of determining the current loudness position of the slide assembly 20 relative to the body 10 by the processor 31 in the embodiment of the present invention, taking the first distance sensor 71 and the second distance sensor 72 as infrared distance sensors as an example.
In the embodiment of the present invention, the current relative position of the sliding assembly 20 with respect to the body 10 is determined based mainly on the characteristics of the first distance sensor 71 and the second distance sensor 72 having the distance measuring function. The infrared distance sensor comprises an infrared transmitting tube and an infrared receiving tube, and when the time for receiving the infrared rays transmitted by the transmitting tube by the receiving tube is short, the infrared distance sensor indicates that the distance is short; when the receiving tube receives the infrared rays emitted by the emitting tube for a longer time, the distance is longer. In the embodiment of the present invention, the measured distance is a relative distance between the first and second distance sensors 71 and 72 and the body 10.
The distances of the first and second distance sensors 71 and 72 with respect to the body 10 are determined according to the sum of the sensed ranging times of the first and second distance sensors 71 and 72. Since the length of time is related to the positions of the first and second distance sensors 71 and 72 and the length of time is related to the length of the distance, the longer the distance the sliding assembly 20 slides out, the longer the receiving time, and whether the sliding assembly 20 is located between the first position a, the second position B or the first position a and the second position B can be determined by comparing the lengths of time. The current relative positions of the first and second distance sensors 71 and 72 with respect to the body 10 can be determined by the signals output from the first and second distance sensors 71 and 72.
In addition, since the first distance sensor 71 and the second distance sensor 72 are respectively fixed on the sliding assembly 20, the first distance sensor 71 and the second distance sensor 72 can generate relative movement with the movement of the sliding assembly 20, and thus, the current relative position of the sliding assembly 20 with respect to the body 10 can be indirectly determined by determining the positions of the second distance sensor 72 and the first distance sensor 71 with respect to the body 10.
In a specific implementation, the sliding assembly 20 may be slid to a plurality of calibration relative positions in advance, a detection signal value output by the first distance sensor 71 and the second distance sensor 72 corresponding to each calibration relative position is obtained and is used as a preset signal value corresponding to the calibration position, and then the plurality of preset signal values and the plurality of calibration positions are associated to a lookup table or fitted to a relationship curve, where the lookup table or the relationship curve includes the plurality of preset signal values and the plurality of calibration relative positions, and each preset signal value corresponds to one calibration relative position. So that after the processor 31 receives the detection signal values output by the first distance sensor 71 and the second distance sensor 72, it can query a pre-generated lookup table or relationship curve according to the detection signal values, thereby determining to reversely derive the current relative position of the sliding assembly 20 with respect to the body 10.
A method and an apparatus for controlling sliding of a sliding component according to an embodiment of the present invention will be described below based on the structure of the electronic apparatus 100 in fig. 1 to 5.
As shown in fig. 1 to 5, the electronic device 100 of the embodiment includes a main body 10, a sliding assembly 20, a driving assembly 50, and a detecting assembly 60, wherein the driving assembly 50 is configured to control the sliding assembly 20 to slide between a first position housed in the main body 10 and a second position exposed from the main body 10, the detecting 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, the first hall element 62 and the second hall element 63 are fixed on the main body 10, and the first hall element 62 is disposed below the second hall element 63.
Fig. 6 is a flowchart illustrating a slip control method of the slip assembly according to an embodiment of the present invention.
As shown in fig. 6, the slip control method includes the steps of:
step 601, acquiring a first interrupt signal sent by a first hall element.
The first interrupt signal is sent after the first Hall element monitors that the value of the output detection signal is larger than a preset calibration signal value.
As an exemplary embodiment, during the use of the electronic device, the first hall element in the electronic device determines the corresponding detection signal value according to the sensed magnetic induction. And after the first Hall element detects that the output detection signal value is greater than the preset calibration signal value, the first Hall element sends a first interrupt signal. Step 602, timing is started according to a preset first delay corresponding to the first interrupt signal, and when the first delay is reached, a first detection signal value currently output by the first hall element is obtained.
Specifically, after receiving a first interrupt signal sent by a first hall element, to avoid the occurrence of a misjudgment situation caused by the first hall element being interfered by other magnetic fields, a first delay corresponding to the first interrupt signal is obtained according to the first interrupt signal and a corresponding relationship between a pre-stored interrupt signal and the delay, timing is started according to the first delay, and a first detection signal value currently output by the first hall element is read after the first delay is detected to be reached.
The first delay time is set by default in the electronic device, or preset by the user in the electronic device according to the requirement, for example, the first delay time may be 10 milliseconds.
Step 603, if the comparison result shows that the first detection signal value is smaller than the calibration signal value, the sliding assembly is switched from the manual operation to the automatic operation, and the driving assembly is started to control the sliding assembly to slide out from the first position to the second position.
In order to determine whether the subsequent sliding of the sliding component is automatically completed by the electronic device, the trouble of additional operation of the sliding component by a user is reduced, and the use of the user is facilitated. After a first detection signal value currently output by the first Hall element is obtained, the first detection signal value can be compared with a calibration signal value, if the first detection signal value is smaller than the calibration signal value through comparison, the sliding assembly is switched from manual operation to automatic operation, and the driving assembly is started to control the sliding assembly to slide out from a first position to a second position. Therefore, the intelligent control sliding assembly slides out from the first position to the second position without other operations of a user, and the use of the user is facilitated.
It should be noted that, if the comparison shows that the first detection signal value is smaller than the calibration signal value, it indicates that the slide module is moving away from the calibration point.
It should be noted that, if the comparison shows that the first detection signal value exceeds the calibration signal value, it indicates that the first hall element may be influenced by other surrounding magnetic field generating objects, so that the currently output first detection signal value exceeds the calibration signal value. In order to avoid misjudgment, when the first detection signal value exceeds the calibration signal value through comparison, the switching function of controlling the sliding assembly to manually operate to automatically operate is closed.
In summary, in the sliding control method of the sliding assembly according to the embodiment, in order to avoid that the hall element is influenced by other magnetic fields, the manual operation of the sliding assembly is switched to the automatic operation by mistake, so as to cause misjudgment, and further, the sliding assembly is controlled to slide in and slide out, so that the sliding assembly is lost, and power consumption is caused to the electronic device. After receiving an interrupt signal of a first Hall element, timing is started according to a preset first delay corresponding to the first interrupt signal, when the first delay is reached, a first detection signal value currently output by the first Hall element is obtained, when the first detection signal value is smaller than a calibration signal value, the sliding assembly is switched from manual operation to automatic operation, and a driving assembly is started to control the sliding assembly to slide out from a first position to a second position.
The sliding control method of the sliding assembly in the embodiment of the invention receives the interrupt signal of the first Hall element, obtains the first detection signal value currently output by the first Hall element after delaying the first delay, compares the first detection signal value with the preset calibration signal value, switches the sliding assembly from manual operation to automatic operation when the first detection signal value is smaller than the preset calibration signal value, and starts the driving assembly to control the sliding assembly to slide out from the first position to the second position. Therefore, when the situation that misjudgment is caused due to the fact that the Hall element is interfered by other magnetic fields is avoided, the intelligent control sliding assembly slides out from the first position to the second position, other operations are not needed by a user, and the intelligent control sliding assembly is convenient for the user to use.
Based on the above embodiment, in the process that the sliding assembly slides from the first position to the second position, since the sliding assembly passes through the calibration point position of the second hall element in the sliding process, at this time, the second interrupt signal sent by the second hall element can be received, timing is started according to a preset second delay corresponding to the second interrupt signal, when the second delay is reached, since the sliding assembly gradually approaches the second hall element, it can be known that the second detection signal value currently output by the second hall element is greater than the calibration signal value through comparison, at this time, the condition that the sliding-in operation is switched from the manual operation to the automatic operation is not satisfied, the condition that the sliding-out operation is switched from the manual operation to the automatic operation is satisfied, and the driving assembly controls the sliding assembly to slide out from the first position to the second position.
Based on the above embodiment, in an actual application process, when the sliding assembly of the electronic device is located at the second position, in order to avoid that the hall element is influenced by other magnetic fields, and thus the manual operation of the sliding assembly is switched to the automatic operation by mistake, so as to cause a false judgment, and further the driving assembly controls the sliding assembly to slide in, so as to cause a loss to the sliding assembly, and cause power consumption to the electronic device, as an exemplary implementation manner, on the basis shown in fig. 6, as shown in fig. 7, the method may further include:
and step 701, acquiring a second interrupt signal sent by the second hall element.
And the second interrupt signal is sent after the second Hall element monitors that the output detection signal value is greater than a preset calibration signal value.
As an exemplary embodiment, during the use of the electronic device, the second hall element in the electronic device determines the corresponding detection signal value according to the sensed magnetic induction. And after the second Hall element detects that the output detection signal value is greater than the preset calibration signal value, the second Hall element sends a second interrupt signal.
And step 702, starting timing according to a preset second delay corresponding to the second interrupt signal, and acquiring a second detection signal value currently output by the second hall element after the second delay is reached.
Specifically, after a second interrupt signal sent by the second hall element is received, in order to avoid the occurrence of a misjudgment situation caused by the interference of the second hall element by other magnetic fields, according to the second interrupt signal and the corresponding relationship between the pre-stored interrupt signal and the time delay, a second time delay corresponding to the second interrupt signal is obtained, timing is started according to the second time delay, and after the second time delay is detected to be reached, a second detection signal value currently output by the second hall element is read.
And 703, if the comparison result shows that the second detection signal value is smaller than the calibration signal value, switching the sliding assembly from manual operation to automatic operation, and starting the driving assembly to control the sliding assembly to slide from the second position to the first position.
In order to determine whether the sliding-in of the subsequent sliding component is automatically completed by the electronic device, the trouble of additional operation of the sliding component by a user is reduced, and the use of the user is facilitated. After a second detection signal value currently output by the second Hall element is obtained, the second detection signal value can be compared with a calibration signal value, if the second detection signal value is smaller than the calibration signal value through comparison, the sliding assembly is switched from manual operation to automatic operation, and the driving assembly is started to control the sliding assembly to slide from the second position to the first position. Therefore, the intelligent control sliding assembly slides out from the second position to the second position without other operations of a user, and the use of the user is facilitated.
It should be noted that, if the comparison result shows that the second detection signal value is smaller than the calibration signal value, it indicates that the slide module is moving away from the calibration point.
It should be noted that, if the comparison shows that the second detection signal value exceeds the calibration signal value, it indicates that the second hall element may be influenced by other surrounding magnetic field generating objects, so that the currently output second detection signal value exceeds the calibration signal value. In order to avoid misjudgment, when the second detection signal value exceeds the calibration signal value through comparison, the switching function of controlling the sliding assembly to manually operate to automatically operate is closed.
In summary, in the sliding control method of the sliding assembly according to the embodiment of the present invention, in order to avoid that the hall element is influenced by other magnetic fields, the manual operation of the sliding assembly is erroneously switched to the automatic operation, so as to cause erroneous determination, and further, the sliding assembly is controlled to slide in and out, so as to cause loss to the sliding assembly and power consumption to the electronic device, after receiving the interrupt signal of the second hall element, the timing is started according to a preset second delay corresponding to the second interrupt signal, when the second delay is reached, a second detection signal value currently output by the second hall element is obtained, and when the second detection signal value is smaller than the calibration signal value, the sliding assembly is switched from the manual operation to the automatic operation, and the driving assembly is started to control the sliding assembly to slide from the second position to the first position. Therefore, when the situation that misjudgment is caused due to the fact that the Hall element is interfered by other magnetic fields is avoided, the intelligent control sliding assembly slides into the first position from the second position, other operations are not needed by a user, and the intelligent control sliding assembly is convenient for the user to use.
It should be understood that, when the magnetic field generated by the surrounding magnet is strong, the detection signal values output by the first hall element and the second hall element may be greater than the calibration signal values corresponding to the first hall element and the second hall element, at this time, after the interrupt information sent by the first hall element and the second hall element is obtained, the first time delay corresponding to the first interrupt signal may be obtained to start timing, when the first time delay is reached, the first detection signal value currently output by the first hall element is obtained, and when the second time delay is reached, the second detection signal value currently output by the second hall element is obtained. If the first detection signal value and the second detection signal value are larger than the corresponding calibration signal values, the condition of starting the switching function from the manual operation to the automatic operation of the sliding assembly is not met, and at the moment, the switching function from the manual operation to the automatic operation of the sliding assembly is continuously in a closed state, so that the sliding assembly is prevented from repeatedly sliding in and sliding out, and the loss of the sliding assembly is reduced.
Based on any of the above embodiments, in order to meet the requirement of the user to individually set the calibration signal value for the slide-out and/or slide-in of the slide module, as shown in fig. 8, the method may further include:
step 801, providing a control interface, and acquiring a calibration signal value set by a user on the control interface according to requirements.
As an exemplary embodiment, in order to facilitate the user to set the corresponding calibration signal value for the slide assembly to slide out and/or into, after the user enters the control interface, the switching function from the manual operation to the automatic operation of the slide assembly may be turned off, and the user may be prompted to set the corresponding calibration signal value for the slide assembly to slide out and/or into the control interface.
It should be noted that the calibration signal values corresponding to the slide-out and slide-in of the slide assembly may be the same or different.
As an example, when the sliding assembly is in the first position, the user may be prompted to manually slide the sliding assembly to a desired calibration position, when the user slides the sliding assembly from the first position to the calibration position, a detection signal value currently output by the first hall element is obtained, and the currently output detection signal value is used as a calibration signal value corresponding to the sliding assembly sliding out, and after receiving a confirmation instruction from the user, the calibration signal value is saved to a reserve partition of the processor, and the calibration signal value is saved to a hardware register of the first hall element through the system interface. Therefore, the corresponding calibration signal value when the sliding assembly which is set by the user in a personalized mode slides out through the control interface meets the requirement of setting the calibration signal value by the user in a personalized mode.
As an example, when the sliding assembly is at the second position, the user may be prompted to slide the sliding assembly from the second position to a desired calibration position, when the user slides the sliding assembly from the second position to the calibration position, the detection signal value currently output by the second hall element is obtained, and the currently output detection signal value is used as a corresponding calibration signal value when the sliding assembly slides out, and after receiving a confirmation instruction from the user, the calibration signal value is saved to a reserve partition of the processor, and the calibration signal value is saved to a hardware register of the second hall element through the system interface. Therefore, the corresponding calibration signal value when the user slides in through the sliding component which is set in a personalized mode on the control interface is enabled to meet the requirement that the user sets the calibration signal value in a personalized mode
Step 802, after detecting that the electronic device is started, writing a calibration signal value into hardware registers of the first hall element and the second hall element.
It should be noted that, in order to avoid that the calibration signal value is not cleared during the flush, as an exemplary embodiment, the corresponding calibration signal value may be saved in the reserve partition of the processor.
After the electronic device is detected to be started, the corresponding interface can be called, and the corresponding calibration signal values stored in the reserve partition can be 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 the subsequent Hall element can conveniently determine whether to send the interrupt signal based on the currently output detection signal value and the calibration signal value.
In one embodiment of the invention, in order to improve the intelligence of the electronic device, the sliding component of the electronic device is prevented from sliding in or out automatically according to the interrupt signal of the hall element under the influence of other objects capable of generating a magnetic field in the using process of the electronic device, and the loss of the sliding component is avoided. Based on any of the above embodiments, as shown in fig. 9, the method may further include:
step 901, monitoring whether the electronic device meets a preset proximity event through a proximity sensor.
And 902, if the electronic device is monitored to meet a preset approach event, writing a first state into the bottom layer driving node, and indicating to close the switching function from manual operation to automatic operation of the sliding assembly.
Step 903, if it is monitored that the electronic device does not meet the preset proximity event, writing a second state in the bottom layer driving node, and instructing to start a switching function from manual operation to automatic operation of the sliding component.
As an example, when it is monitored that an event reported by the proximity sensor is a far event, it may be detected that the electronic device does not meet a preset proximity event, and at this time, a second state may be written in the bottom layer driving node to instruct to start a switching function from manual operation to automatic operation of the sliding component.
In this example, whether the electronic device meets the preset proximity event is monitored through the proximity sensor, and when the electronic device meets the preset proximity event is monitored, the first state is written in the bottom layer driving node, and the switching function from manual operation to automatic operation is indicated to be closed.
And when the situation that the electronic device does not meet the preset approaching event is monitored, a second state is written in the bottom layer driving node, and the switching function from manual operation to automatic operation of the sliding assembly is indicated to be started, so that the electronic device automatically finishes sliding in and sliding out of the sliding assembly through the driving assembly when the detection signal value output by the Hall element meets the requirement in the subsequent use process, the user does not need to perform other operations on the sliding assembly, and the use of the user is facilitated.
It should be noted that, in practical applications, when the electronic apparatus is in a bright screen state, a body part of a user, for example, a hand, may approach the electronic device sometimes, at this time, a proximity sensor in the electronic apparatus detects a proximity event and reports the proximity event, at this time, if a switching function from manual operation to automatic operation of the sliding component is closed according to the reported proximity event, the electronic apparatus automatically completes sliding in and sliding out of the sliding component, and during a process of using the electronic device, the user needs to perform another operation on the sliding component, for example, the user manually slides in and slides out the sliding component, thereby resulting in an unsatisfactory user experience of the electronic apparatus.
As an exemplary embodiment, in order to facilitate the user to use the electronic device, on the basis of fig. 9, as shown in fig. 10, the method may further include:
step 101, monitoring the screen state of the electronic device.
And 102, if the electronic device is monitored to be in a bright screen state, locking a second state written in by the bottom layer driving node, and forbidding state modification on the second state when the electronic device meets a preset approach event.
And 103, if the electronic device is monitored to be in the screen-off state, unlocking the second state written in by the bottom layer driving node, and allowing the second state to be modified into the first state when the electronic device meets a preset approach event.
In this example, when the electronic device is monitored to be in a bright screen state, the electronic device is enabled to start the switching function from manual operation to automatic operation of the sliding assembly by locking the second state written in by the bottom layer driving node, and therefore, the sliding assembly can be conveniently controlled to slide in and out through the driving assembly when the detection signal value output by the hall element meets the requirement in the subsequent use process of the electronic device, so that the user does not need to perform other operations on the sliding assembly, and the use of the user is facilitated.
And when the situation that the electronic device is in the screen-off state is monitored, the second state written in by the bottom layer driving node is unlocked, so that the second state is allowed to be modified into the first state when the electronic device meets a preset approaching event, therefore, the situation that when the electronic device is in the screen-off state, manual operation of the sliding assembly is switched to automatic operation due to other objects generating magnetic fields, the sliding assembly slides out and slides in repeatedly can be avoided, the loss of the sliding assembly is reduced, the power consumption of the electronic device is reduced, and the user experience is improved.
For example, in the process of placing the electronic device in the screen-off state in the backpack, if there is another object capable of generating a magnetic field, such as another mobile phone, in the backpack, at this time, the hall element in the electronic device may sense the magnetic induction intensity to output a corresponding detection signal value, if the hall element monitors that the output detection signal value is greater than a preset calibration signal, the hall element sends an interrupt signal, after receiving the interrupt signal, obtains a delay corresponding to the interrupt signal, and after delaying the corresponding time, obtains a detection signal value currently output by the hall element. At this time, even if the currently output detection signal value is known to be smaller than the preset calibration signal value through comparison, the slide module in the electronic device cannot be switched from the manual operation to the automatic operation. This is because the switching function of the sliding assembly in the electronic device, which is manually operated to automatically operate, is in the off state when the electronic device is in the screen-off state. Therefore, the situation that the electronic device switches the sliding assembly from manual operation to automatic operation to cause influence on the sliding assembly due to magnetic field interference in the backpack process of the electronic device can be avoided.
Fig. 11 is a schematic structural view of a slide control device of the slide module according to an embodiment of the present invention.
It should be noted that the electronic device 100 includes a body 10, a sliding assembly 20, a driving assembly 50 and a detecting assembly 60, where the driving assembly 50 is used to control the sliding assembly 20 to slide between a first position housed in the body 10 and a second position exposed from the body 10, the detecting 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, the first hall element 62 and the second hall element 63 are fixed on the body 10, and the first hall element 62 is disposed below the second hall element 63, as shown in fig. 10, the sliding control device 80 may include a first obtaining module 110, a second obtaining module 120 and a first control module 130, where:
the first obtaining module 110 is configured to obtain a first interrupt signal sent by the first hall element, where the first interrupt signal is sent after the first hall element monitors that an output detection signal value 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 obtain a first detection signal value currently output by the first hall element after the first delay is reached.
And the first control module 130 is configured to switch the sliding assembly from the manual operation to the automatic operation when the comparison result shows that the first detection signal value is smaller than the calibration signal value, and start the driving assembly to control the sliding assembly to slide out from the first position to the second position.
In an embodiment of the present invention, on the basis of fig. 11, as shown in fig. 12, the apparatus may further include:
the third obtaining module 140 is configured to obtain a second interrupt signal sent by the second hall element, where the second interrupt signal is sent after the second hall element monitors that the output detection signal value is greater than a preset calibration signal value.
And a fourth obtaining module 150, configured to start timing according to a preset second delay corresponding to the second interrupt signal, and obtain a second detection signal value currently output by the second hall element after the second delay is reached.
And the second control module 160 is configured to switch the sliding assembly from the manual operation to the automatic operation when the comparison result shows that the second detection signal value is smaller than the calibration signal value, and start the driving assembly to control the sliding assembly to slide from the second position to the first position.
In this example, in order to avoid that the hall element is influenced by other magnetic fields, the manual operation of the sliding assembly is switched to the automatic operation by mistake, so that misjudgment is caused, and then the sliding assembly is controlled to slide in and slide out, so that loss is caused to the sliding assembly, and power consumption is caused to the electronic device. And after receiving an interrupt signal of the second Hall element, starting timing according to a preset second delay corresponding to the second interrupt signal, acquiring a second detection signal value currently output by the second Hall element after reaching the second delay, switching the sliding assembly from manual operation to automatic operation when the second detection signal value is smaller than a calibration signal value, and starting the driving assembly to control the sliding assembly to slide from the second position to the first position.
In an embodiment of the present invention, in order to meet the requirement of the user to individually set the calibration signal value for the sliding component to slide in and/or slide out, on the basis of the value shown in fig. 11, as shown in fig. 13, the apparatus may further include:
the providing module 170 is configured to provide a control interface, and obtain a calibration signal value set on the control interface by a user according to a requirement.
And the sending module 180 is configured to write a calibration signal value into hardware registers of the first hall element and the second hall element after detecting that the electronic device is started.
As an example, when the sliding assembly is in the first position, the user may be prompted to manually slide the sliding assembly to a desired calibration position, when the user slides the sliding assembly from the first position to the calibration position, a detection signal value currently output by the first hall element is obtained, and the currently output detection signal value is used as a calibration signal value corresponding to the sliding assembly sliding out, and after receiving a confirmation instruction from the user, the calibration signal value is saved to a reserve partition of the processor, and the calibration signal value is saved to a hardware register of the first hall element through the system interface.
As an example, when the sliding assembly is at the second position, the user may be prompted to slide the sliding assembly from the second position to a desired calibration position, when the user slides the sliding assembly from the second position to the calibration position, the detection signal value currently output by the second hall element is obtained, and the currently output detection signal value is used as a corresponding calibration signal value when the sliding assembly slides out, and after receiving a confirmation instruction from the user, the calibration signal value is saved to a reserve partition of the processor, and the calibration signal value is saved to a hardware register of the second hall element through the system interface.
It should be noted that, 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, and the embodiment is not limited thereto.
In an embodiment of the present invention, on the basis of fig. 11, as shown in fig. 14, the apparatus may further include:
the determining module 190 is configured to monitor whether the electronic device meets a preset proximity event through the proximity sensor.
The third processing module 200 is configured to write a first state in the bottom layer driving node when it is monitored that the electronic device meets a preset proximity event, and instruct to close a switching function from manual operation to automatic operation of the sliding component.
The fourth processing module 210 is configured to write a second state in the bottom layer driving node when it is monitored that the electronic device does not meet the preset proximity event, and instruct to start a switching function from manual operation to automatic operation of the sliding component.
In this example, whether the electronic device meets the preset proximity event is monitored through the proximity sensor, and when the electronic device meets the preset proximity event is monitored, the first state is written in the bottom layer driving node, and the switching function from manual operation to automatic operation is indicated to be closed.
And when the situation that the electronic device does not meet the preset approaching event is monitored, a second state is written in the bottom layer driving node, and the switching function from manual operation to automatic operation of the sliding assembly is instructed to be started, so that the electronic device can automatically slide in and slide out the sliding assembly subsequently without additional operation of a user on the sliding assembly, and the electronic device is convenient for the user to use.
In one embodiment of the present invention, as shown in fig. 14, the apparatus may further include:
the monitoring module 220 is configured to monitor a screen status of the electronic device.
And the locking module 230 is configured to lock a second state written by the bottom driver node when it is monitored that the electronic device is in a bright screen state, and prohibit a state modification of the second state when the electronic device meets a preset proximity event.
And the unlocking module 240 is configured to unlock the second state written by the bottom layer driving node when it is monitored that the electronic device is in the screen-off state, and allow the second state to be modified into the first state when the electronic device meets a preset proximity event.
It should be noted that the foregoing explanation of the electronic device and the sliding control method of the sliding assembly is also applicable to the sliding control device of the sliding assembly of this embodiment, and is not repeated here.
The sliding control device of the sliding assembly in the embodiment of the invention receives the interrupt signal of the first Hall element, obtains the first detection signal value currently output by the first Hall element after delaying the first delay, compares the first detection signal value with the preset calibration signal value, switches the sliding assembly from manual operation to automatic operation when the first detection signal value is smaller than the preset calibration signal value, and starts the driving assembly to control the sliding assembly to slide out from the first position to the second position. Therefore, when the situation that misjudgment is caused due to the fact that the Hall element is interfered by other magnetic fields is avoided, the intelligent control sliding assembly slides out from the first position to the second position, other operations are not needed by a user, and the intelligent control sliding assembly is convenient for the user to use.
In order to implement the above-mentioned embodiments, the present invention also proposes a computer-readable storage medium on which a computer program is stored, which when executed by a processor implements the sliding control method of the sliding assembly of the above-mentioned embodiments.
In order to implement the above embodiments, the present invention further provides a computer program product, and when instructions in the computer program product are executed by a processor, the method for controlling sliding of a sliding assembly of the above embodiments is performed.
In the description herein, references to the terms "one embodiment," "certain embodiments," "an illustrative embodiment," "an example," "a specific example," or "some examples" or the like mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
While embodiments of the present invention have been shown and described, it will be understood by those of ordinary skill in the art that: various changes, modifications, substitutions and alterations can be made to the embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.

Claims (8)

1. A sliding control method of a sliding assembly is characterized in that the sliding assembly is used for an electronic device, the electronic device comprises a body, a detection assembly and a driving assembly, the driving assembly is used for controlling the sliding assembly to slide between a first position accommodated in the body and a second position exposed out of the body, the detection assembly comprises a magnetic field generating element, a first Hall element and a second Hall element, the magnetic field generating element is fixed on the sliding assembly, the first Hall element and the second Hall element are fixed on the body, the first Hall element is arranged below the second Hall element, and the sliding control method comprises the following steps:
acquiring a first interrupt signal sent by the first Hall element, wherein the first interrupt signal is sent after the first Hall element monitors that the value of an output detection signal is larger than a preset calibration signal value;
starting timing according to a preset first delay corresponding to the first interrupt signal, and acquiring a first detection signal value currently output by the first Hall element after the first delay is reached;
if the first detection signal value is smaller than the calibration signal value, switching the sliding assembly from manual operation to automatic operation, and starting the driving assembly to control the sliding assembly to slide out from the first position to the second position;
further comprising:
monitoring whether the electronic device meets a preset proximity event or not through a proximity sensor;
if the electronic device is monitored to meet a preset approaching event, writing a first state into a bottom layer driving node, and indicating to close a switching function from manual operation to automatic operation of the sliding assembly;
if the electronic device is monitored not to meet the preset approaching event, writing a second state into a bottom layer driving node, and indicating to start a switching function from manual operation to automatic operation of the sliding assembly;
further comprising:
monitoring the screen state of the electronic device;
if the electronic device is monitored to be in a bright screen state, locking a second state written in by the bottom layer driving node, and forbidding state modification on the second state when the electronic device meets a preset approach event;
and if the electronic device is monitored to be in a screen-off state, unlocking a second state written in by the bottom layer driving node, and allowing the second state to be modified into the first state when the electronic device meets a preset approach event.
2. The method of claim 1, further comprising:
acquiring a second interrupt signal sent by the second Hall element, wherein the second interrupt signal is sent after the second Hall element monitors that the output detection signal value is greater than a preset calibration signal value;
starting timing according to a preset second delay corresponding to the second interrupt signal, and acquiring a second detection signal value currently output by the second Hall element after the second delay is reached;
and if the second detection signal value is smaller than the calibration signal value, switching the sliding assembly from manual operation to automatic operation, and starting the driving assembly to control the sliding assembly to slide from the second position to the first position.
3. The method of claim 1, further comprising:
providing a control interface, and acquiring the calibration signal value set on the control interface by a user according to the requirement;
and writing the calibration signal value into hardware registers of the first Hall element and the second Hall element after detecting that the electronic device is started.
4. The sliding control device of the sliding assembly is characterized in that the sliding assembly is used for an electronic device, the electronic device comprises a body, a detection assembly and a driving assembly, the driving assembly is used for controlling the sliding assembly to slide between a first position accommodated in the body and a second position exposed from the body, the detection assembly comprises a magnetic field generation element, a first Hall element and a second Hall element, the magnetic field generation element is fixed on the sliding assembly, the first Hall element and the second Hall element are fixed on the body, the first Hall element is arranged below the second Hall element, and the sliding control device comprises:
the first acquisition module is used for acquiring a first interrupt signal sent by the first Hall element, wherein the first interrupt signal is sent after the first Hall element monitors that the output detection signal value is greater than a preset calibration signal value;
the second acquisition module is used for starting timing according to a preset first delay corresponding to the first interrupt signal, and acquiring a first detection signal value currently output by the first Hall element after the first delay is reached;
and the first control module is used for switching the sliding assembly from manual operation to automatic operation and starting the driving assembly to control the sliding assembly to slide out from the first position to the second position when the comparison result shows that the first detection signal value is smaller than the calibration signal value.
5. The apparatus of claim 4, further comprising:
the third acquisition module is used for acquiring a second interrupt signal sent by the second hall element, wherein the second interrupt signal is sent after the second hall element monitors that the output detection signal value is greater than a preset calibration signal value;
the fourth obtaining module is used for starting timing according to a preset second delay corresponding to the second interrupt signal, and obtaining a second detection signal value currently output by the second Hall element after the second delay is reached;
the second control module is used for switching the sliding assembly from manual operation to automatic operation when the second detection signal value is smaller than the calibration signal value through comparison, and starting the driving assembly to control the sliding assembly to slide from the second position to the first position;
the judging module is used for monitoring whether the electronic device meets a preset proximity event or not through a proximity sensor;
the third processing module is used for writing a first state into a bottom layer driving node when the electronic device meets a preset approaching event and indicating to close a switching function from manual operation to automatic operation of the sliding assembly;
the fourth processing module is used for writing a second state into the bottom layer driving node when the electronic device is monitored not to meet the preset approaching event, and indicating to start a switching function from manual operation to automatic operation of the sliding assembly;
the monitoring module is used for monitoring the screen state of the electronic device;
the locking module is used for locking a second state written by the bottom layer driving node when the electronic device is monitored to be in a bright screen state, and forbidding state modification on the second state when the electronic device meets a preset approach event;
and the unlocking module is used for unlocking the second state written by the bottom layer driving node when the situation that the electronic device is in the screen-off state is monitored, and allowing the second state to be modified into the first state when the electronic device meets a preset approach event.
6. The apparatus of claim 5, further comprising:
the providing module is used for providing a control interface and acquiring the calibration signal value set on the control interface by a user according to the requirement;
and the sending module is used for writing the calibration signal value into hardware registers of the first Hall element and the second Hall element after detecting that the electronic device is started.
7. An electronic device, characterized in that, the electronic device includes a body, a sliding assembly, a detection assembly and a driving assembly, the driving assembly is used for controlling the sliding assembly to slide between a first position accommodated in the body and a second position exposed from the body, the detection assembly includes a magnetic field generating element, a first hall element and a second hall element, the magnetic field generating element is fixed on the sliding assembly, the first hall element and the second hall element are fixed on the body, the first hall element is arranged below the second hall element, the electronic device further includes: a memory, a processor electrically connected to the sliding assembly, the detecting assembly and the driving assembly, and a computer program stored in the memory and executable on the processor, wherein the processor implements the sliding control method of the sliding assembly according to any one of claims 1 to 3 when executing the program.
8. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements a slide control method of a slide module according to any one of claims 1 to 3.
CN201810860284.XA 2018-08-01 2018-08-01 Sliding control method and device for sliding assembly, electronic device and storage medium Active CN109151106B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201810860284.XA CN109151106B (en) 2018-08-01 2018-08-01 Sliding control method and device for sliding assembly, electronic device and storage medium
PCT/CN2019/091542 WO2020024711A1 (en) 2018-08-01 2019-06-17 Sliding control method and device for sliding component, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810860284.XA CN109151106B (en) 2018-08-01 2018-08-01 Sliding control method and device for sliding assembly, electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN109151106A CN109151106A (en) 2019-01-04
CN109151106B true CN109151106B (en) 2020-06-19

Family

ID=64798481

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810860284.XA Active CN109151106B (en) 2018-08-01 2018-08-01 Sliding control method and device for sliding assembly, electronic device and storage medium

Country Status (2)

Country Link
CN (1) CN109151106B (en)
WO (1) WO2020024711A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109151106B (en) * 2018-08-01 2020-06-19 Oppo广东移动通信有限公司 Sliding control method and device for sliding assembly, electronic device and storage medium
CN110650231A (en) * 2019-09-27 2020-01-03 维沃移动通信有限公司 Electronic device and control method of electronic device
CN112328082B (en) * 2020-11-10 2022-12-20 昆山国显光电有限公司 Slip terminal and correction method for displacement detection of slip terminal

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107291313A (en) * 2017-07-05 2017-10-24 广东欧珀移动通信有限公司 Control method, device, storage medium and mobile terminal that a kind of fingerprint wakes up

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3974589B2 (en) * 2004-03-22 2007-09-12 株式会社東芝 Portable information terminal
CN102957763A (en) * 2011-08-18 2013-03-06 希姆通信息技术(上海)有限公司 Mobile phone
CN107295190A (en) * 2017-07-10 2017-10-24 北京小米移动软件有限公司 Working mode switching method, device and protective case
CN108234700A (en) * 2018-01-08 2018-06-29 广州视源电子科技股份有限公司 Electronic equipment
CN109151106B (en) * 2018-08-01 2020-06-19 Oppo广东移动通信有限公司 Sliding control method and device for sliding assembly, electronic device and storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107291313A (en) * 2017-07-05 2017-10-24 广东欧珀移动通信有限公司 Control method, device, storage medium and mobile terminal that a kind of fingerprint wakes up

Also Published As

Publication number Publication date
WO2020024711A1 (en) 2020-02-06
CN109151106A (en) 2019-01-04

Similar Documents

Publication Publication Date Title
CN109151106B (en) Sliding control method and device for sliding assembly, electronic device and storage medium
CN108833623B (en) Sliding control method and device of sliding assembly and electronic device
CN108897375B (en) Control method and device for sliding mechanism, electronic device and storage medium
EP3166036B1 (en) Terminal having fingerprint identification function
CN109547598B (en) Camera module control method and device
CN108829461B (en) Camera starting control method and device and electronic equipment
CN104601195A (en) Antenna control method and device
CN109246361B (en) Camera module control method and device
CN108924283B (en) Sliding control method and device of sliding assembly and electronic device
CN109542174B (en) Method and device for correcting sliding of sliding component
CN108833699B (en) Electronic device and control method and device of sliding assembly of electronic device
CN108833697B (en) Control method of sliding assembly, control assembly, electronic device and storage medium
JP2005155126A (en) Back door automatic opening-closing device
EP2907705A1 (en) Control device and vehicle control system
CN108900663B (en) Sliding control method and device of sliding assembly and electronic device
US11173895B2 (en) Parking support apparatus
EP2587235B1 (en) Lighting device, lighting control device and lighting system
US11425234B2 (en) Sliding control method for sliding assembly, electronic device, and non-transitory computer-readable storage medium
CN113037900B (en) Control method, electronic device, and readable storage medium
US20190297251A1 (en) Method for detecting position of movable structure, detection component, and electronic device
CN108924284B (en) Electronic device and control method and device of sliding assembly of electronic device
CN108924286B (en) Electronic device and control method and device of sliding assembly of electronic device
KR20190051637A (en) Apparatus and method for supporting remote parking based on posion of fob
CN108924289B (en) Control method and device for sliding mechanism, electronic device and storage medium
CN108989493B (en) Control method of sliding mechanism, control assembly, electronic device and storage medium

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
GR01 Patent grant
GR01 Patent grant