CN108958370B - Control method and device for sliding mechanism, electronic device and storage medium - Google Patents

Control method and device for sliding mechanism, electronic device and storage medium Download PDF

Info

Publication number
CN108958370B
CN108958370B CN201810603655.6A CN201810603655A CN108958370B CN 108958370 B CN108958370 B CN 108958370B CN 201810603655 A CN201810603655 A CN 201810603655A CN 108958370 B CN108958370 B CN 108958370B
Authority
CN
China
Prior art keywords
magnetic field
sliding mechanism
signal value
field detector
slide
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
CN201810603655.6A
Other languages
Chinese (zh)
Other versions
CN108958370A (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 CN201810603655.6A priority Critical patent/CN108958370B/en
Publication of CN108958370A publication Critical patent/CN108958370A/en
Application granted granted Critical
Publication of CN108958370B publication Critical patent/CN108958370B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/16Constructional details or arrangements
    • G06F1/1613Constructional details or arrangements for portable computers
    • G06F1/1615Constructional details or arrangements for portable computers with several enclosures having relative motions, each enclosure supporting at least one I/O or computing function

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Computer Hardware Design (AREA)
  • Human Computer Interaction (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Selective Calling Equipment (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The invention provides a control method, a control device, electronic equipment and a storage medium of a sliding mechanism, wherein the method comprises the steps of receiving a magnetic field signal value detected by a magnetic field detector; judging whether the comparison result of the magnetic field signal value and the calibration magnetic field signal value meets a preset condition or not; and when the comparison result meets a preset condition, triggering the automatic control sliding mechanism to slide. The invention can more simply, conveniently and efficiently control the sliding in and out of the sliding mechanism on the electronic equipment and improve the automation of the sliding control of the sliding mechanism.

Description

Control method and device for sliding mechanism, electronic device and storage medium
Technical Field
The present invention relates to the field of electronic devices, and in particular, to a method and an apparatus for controlling a sliding mechanism, an electronic device, and a storage medium.
Background
In order to improve user experience, the screen occupation ratio of electronic equipment is getting larger and larger, and even the design of a full screen has been proposed, so how to optimally control the sliding-in and sliding-out of a sliding mechanism on the electronic equipment more simply, quickly and efficiently becomes a problem to be solved urgently.
Disclosure of Invention
The present invention is directed to solving, at least to some extent, one of the technical problems in the related art.
Therefore, an object of the present invention is to provide a method for controlling a sliding mechanism, which can control the sliding mechanism on an electronic device to slide in and out more simply and efficiently, and improve the automation of the sliding control of the sliding mechanism.
Another object of the present invention is to provide a control device for a slide mechanism.
Another object of the present invention is to provide an electronic device.
Another object of the present invention is to provide a computer-readable storage medium.
In order to achieve the above object, a control method for a sliding mechanism according to an embodiment of a first aspect of the present invention is applied to an electronic device, where the electronic device includes a body and the sliding mechanism, the body is provided with a magnetic field detector, the sliding mechanism is provided with a magnetic field generating element, and the sliding mechanism is movable relative to the body to protrude from a sidewall of the body or be located inside the body, and includes: receiving a magnetic field signal value detected by a magnetic field detector; judging whether the comparison result of the magnetic field signal value and the calibration magnetic field signal value meets a preset condition or not; and when the comparison result meets the preset condition, triggering to automatically control the sliding mechanism to slide.
In the control method of the sliding mechanism provided in the embodiment of the first aspect of the present invention, by determining whether the comparison result between the magnetic field signal value and the calibration magnetic field signal value satisfies the preset condition, and triggering the automatic control sliding mechanism to slide when the comparison result satisfies the preset condition, the sliding mechanism on the electronic device can be controlled to slide in and out more simply and efficiently, and the automation of the sliding control of the sliding mechanism is improved.
In order to achieve the above object, a control device for a sliding mechanism according to an embodiment of a second aspect of the present invention is applied to an electronic device, the electronic device includes a body and a sliding mechanism, the body is provided with a magnetic field detector, the sliding mechanism is provided with a magnetic field generating element, and the sliding mechanism is movable relative to the body to protrude from a sidewall of the body or be located inside the body, and includes: the receiving module is used for receiving the magnetic field signal value detected by the magnetic field detector; the judging module is used for judging whether the comparison result of the magnetic field signal value and the calibration magnetic field signal value meets a preset condition or not; and the control module is used for triggering the sliding mechanism to automatically control to slide when the comparison result meets the preset condition.
The control device for the sliding mechanism provided by the embodiment of the second aspect of the invention triggers the automatic control sliding mechanism to slide by judging whether the comparison result of the magnetic field signal value and the calibration magnetic field signal value meets the preset condition or not and triggering the automatic control sliding mechanism to slide when the comparison result meets the preset condition, so that the sliding mechanism on the electronic equipment can be controlled to slide in and out more simply, conveniently and efficiently, and the automation of the sliding control of the sliding mechanism is improved.
In order to achieve the above object, an electronic device according to a third aspect of the present invention includes a body, a magnetic field detector disposed on the body, and a sliding mechanism disposed on the sliding mechanism, wherein the sliding mechanism is movable relative to the body to protrude from a sidewall of the body or to be located inside the body, and the electronic device further includes: the sliding mechanism control method comprises a memory, a processor electrically connected with the sliding mechanism and a computer program which is stored on the memory and can run on the processor, wherein when the processor executes the program, the control method of the sliding mechanism provided by the embodiment of the first aspect of the invention is realized.
According to the electronic device provided by the embodiment of the third aspect of the invention, whether the comparison result of the magnetic field signal value and the calibration magnetic field signal value meets the preset condition or not is judged, and when the comparison result meets the preset condition, the automatic control sliding mechanism is triggered to slide, so that the sliding in and sliding out of the sliding mechanism on the electronic device can be controlled more simply, more simply and more efficiently, and the automation of the sliding control of the sliding mechanism is improved.
To achieve the above object, a computer-readable storage medium according to a fourth embodiment of the present invention stores thereon a computer program, wherein the computer program is executed by a processor to implement the method for controlling a sliding mechanism according to the first embodiment of the present invention.
According to the computer-readable storage medium provided by the embodiment of the fourth aspect of the invention, whether the comparison result of the magnetic field signal value and the calibration magnetic field signal value meets the preset condition or not is judged, and when the comparison result meets the preset condition, the automatic control sliding mechanism is triggered to slide, so that the sliding in and out of the sliding mechanism on the electronic equipment can be controlled more simply, conveniently and efficiently, and the automation of the sliding control of the sliding mechanism is improved.
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 foregoing 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 flowchart of a control method of a sliding mechanism according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of an electronic device according to an embodiment of the invention;
fig. 3 is a schematic flowchart of a control method of a sliding mechanism according to another embodiment of the present invention;
fig. 4 is a flowchart illustrating a method for controlling the sliding mechanism according to another embodiment of the present invention;
fig. 5 is a schematic structural diagram of a control device of a sliding mechanism according to an embodiment of the present invention;
fig. 6 is a schematic structural view of a control device of a slide mechanism according to another embodiment of the present invention;
fig. 7 is a schematic structural view of a control device of a slide mechanism according to another embodiment of the present invention;
fig. 8 is a schematic structural diagram of an electronic device according to another embodiment of the present invention.
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 or similar 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. On the contrary, the embodiments of the invention include all changes, modifications and equivalents coming within the spirit and terms of the claims appended hereto.
Fig. 1 is a flowchart illustrating a method for controlling a sliding mechanism according to an embodiment of the present invention.
The present embodiment is exemplified in a case where the control method of the slide mechanism is configured as the control apparatus of the slide mechanism.
The control method of the sliding mechanism in the present embodiment may be configured in the control device of the sliding mechanism, and the control device of the sliding mechanism may be provided in the electronic apparatus, which is not limited thereto.
The present embodiment takes an example in which the control method of the slide mechanism is configured in the electronic apparatus.
Among them, electronic devices such as smart phones, tablet computers, personal digital assistants, electronic books, and other hardware devices having various operating systems.
It should be noted that, the execution main body in the embodiment of the present invention may be, for example, a Central Processing Unit (CPU) in the electronic device in terms of hardware, and may be, for example, a related background service in the electronic device in terms of software, which is not limited to this.
In order to improve user experience, the screen occupation ratio of electronic equipment is getting larger and larger, and even the design of a full screen has been proposed, so how to optimally control the sliding-in and sliding-out of a sliding mechanism on the electronic equipment more simply, quickly and efficiently becomes a problem to be solved urgently.
In order to solve the above technical problem, an embodiment of the present invention provides a method for controlling a sliding mechanism, which determines whether a comparison result between a magnetic field signal value and a calibration magnetic field signal value satisfies a preset condition, and when the comparison result satisfies the preset condition, triggers an automatic sliding mechanism to slide, so that the sliding mechanism can be controlled to slide in and out on an electronic device more simply, conveniently and efficiently, and the automation of sliding control of the sliding mechanism is improved.
Referring to fig. 2, an electronic device 200 according to an embodiment of the present invention includes a main body 201 and a sliding mechanism 202, a magnetic field detector 203 is disposed on the main body 201, a magnetic field generating element 204 is disposed on the sliding mechanism 202, and the sliding mechanism 202 is movable relative to the main body 201 to protrude from a sidewall of the main body 201 or to be located inside the main body 201.
As an example, the present invention is illustrated by configuring two magnetic field detectors, and the configuration is not limited thereto. The magnetic field sensor 203 includes a first magnetic field sensor 2031 and a second magnetic field sensor 2032, the first magnetic field sensor 2031 and the second magnetic field sensor 2032 being disposed in parallel on the body 201.
Referring to fig. 1, the method includes:
s101: the magnetic field signal values detected by the magnetic field detector are received.
The magnetic field detectors are hall elements, and the number of the magnetic field detectors can be one or more.
The sliding mechanism in the embodiment of the invention can be loaded with a camera device, the camera device is arranged on a sliding mechanism which can slide, and the camera device is controlled by the up-and-down sliding of the motor to protrude out of the side wall of the body or be positioned in the body.
In the embodiment of the invention, the body is provided with the magnetic field detector, the sliding mechanism is provided with the magnetic field generating element, the magnetic field detector comprises the first magnetic field detector and the second magnetic field detector, the first magnetic field detector and the second magnetic field detector are arranged on the body in parallel, and the sliding mechanism is triggered to slide by the principle that the magnetic attraction or the magnetic repulsion exists between the sliding mechanism and the magnetic field generating element arranged on the body.
In order to realize more simple and efficient control of sliding in and sliding out of a sliding mechanism on electronic equipment, the embodiment of the invention can be provided with two magnetic field detectors, each magnetic field detector comprises a first magnetic field detector and a second magnetic field detector, the first magnetic field detector and the second magnetic field detector are arranged on the body in parallel, whether a comparison result of a magnetic field signal value and a calibration magnetic field signal value meets a preset condition or not is judged by receiving a magnetic field signal value detected by the magnetic field detectors, and when the comparison result meets the preset condition, the sliding mechanism is triggered to automatically control to slide.
For this reason, referring to fig. 3, in the embodiment of the present invention, before S101, the method may further include:
s301: and respectively writing a calibration magnetic field signal value into a hardware register corresponding to each magnetic field detector, wherein the calibration magnetic field signal value is determined through experiments.
The embodiment of the invention can also configure a hardware register for each magnetic field detector when two magnetic field detectors are configured, allocate a corresponding register area for the signal value detected by each magnetic field detector in the hardware register, and write a calibration magnetic field signal value into the hardware register corresponding to each magnetic field detector when the hardware register is configured in advance, wherein the calibration magnetic field signal value comprises a calibration magnetic field signal value corresponding to the first magnetic field detector and a calibration magnetic field signal value corresponding to the second magnetic field detector, and the calibration magnetic field signal value is determined through experiments, and can be used as a reference to determine whether to trigger the automatic control sliding mechanism to slide.
After the calibration magnetic field signal values are written into the hardware registers corresponding to the magnetic field detectors in advance, the embodiment of the invention can receive the magnetic field signal values detected by the magnetic field detectors and judge whether the comparison result of the magnetic field signal values and the calibration magnetic field signal values meets the preset condition; and when the comparison result meets a preset condition, triggering the automatic control sliding mechanism to slide.
S102: and judging whether the comparison result of the magnetic field signal value and the calibration magnetic field signal value meets a preset condition or not.
According to the embodiment of the invention, when the magnetic field signal value is smaller than the calibration magnetic field signal value corresponding to any magnetic field detector, the comparison result is determined to meet the preset condition.
In the embodiment of the present invention, the working principle of the magnetic field detector arranged on the body of the electronic device and the magnetic field generating element arranged on the sliding mechanism is combined, and if the magnetic field signal value is smaller than the calibration magnetic field signal value corresponding to a certain magnetic field detector, it indicates that the sliding mechanism carrying magnetic field generating element is sliding in the direction away from the calibration point, and at this time, the sliding mechanism can be triggered to automatically control to slide, so that the preset conditions can be configured as: when the magnetic field signal value is smaller than the calibration magnetic field signal value corresponding to any magnetic field detector, the comparison result is determined to meet the preset condition, so that the judgment means can be tightly attached to the actual working principle, and the method is easy to realize from the technical angle.
S103: and when the comparison result meets a preset condition, triggering the automatic control sliding mechanism to slide.
According to the embodiment of the invention, when the comparison result meets the preset condition, the time which passes after the preset condition is met is determined; if the elapsed time reaches the preset time threshold, the magnetic field detector with the comparison result meeting the preset condition is used as the target magnetic field detector, the sliding mechanism is automatically controlled to slide based on the target magnetic field detector, and the accuracy of determining the target magnetic field detector can be effectively improved.
The target magnetic field detector is one of the magnetic field detectors, and the comparison result meets the preset condition.
According to the embodiment of the invention, after the calibration magnetic field signal value is written into the hardware register corresponding to the magnetic field detector in advance, the magnetic field signal value detected by the magnetic field detector can be received, when the magnetic field signal value is smaller than the calibration magnetic field signal value, the comparison result is determined to meet the preset condition, then the sliding mechanism is triggered to automatically control to slide, the triggering time can be simply, rapidly and efficiently determined, and the calibration magnetic field signal value is determined through experiments, so that the accuracy of determining the triggering time can be ensured, and the requirement of practical application scenes is met.
In some other embodiments, referring to fig. 4, S101 may further include:
s401: a first user input is received.
The first user input indicates an operation input of the electronic device by a user.
S402: and triggering and receiving the magnetic field signal value detected by the magnetic field detector when the first user input is that the target application program is operated by the electronic equipment.
The target application may be, for example, a photo application.
When the user triggers and starts the photographing application program, the sliding mechanism carrying the camera device can be triggered and started to slide out of the electronic equipment so as to protrude out of the side wall of the electronic equipment for photographing.
The user trigger input to start the photo-like application may be referred to as a first user input.
Therefore, in the embodiment of the present invention, when the first user input is that the target application program is run on the electronic device, the magnetic field signal value detected by the magnetic field detector is triggered and received, and whether the comparison result between the magnetic field signal value and the calibration magnetic field signal value meets the preset condition is determined; when the comparison result meets the preset condition, the sliding mechanism is triggered to slide automatically, the user requirement can be accurately detected, and the sliding mechanism is triggered to slide automatically on the time node most needed by the user.
Or, in the embodiment of the present invention, in order to better and timely monitor the user requirement, a second user input may be further received, and when the second user input is to control the sliding mechanism to slide, the magnetic field signal value detected by the magnetic field detector is triggered and received.
Wherein the second user input indicates another operation input of the electronic device by the user.
The second user input in the embodiment of the present invention is specifically a control input that the user manually triggers the sliding of the sliding mechanism, for example, the second user input is that the user manually pushes the sliding mechanism to slide.
In the embodiment of the invention, when a user manually pushes the sliding mechanism to slide, the magnetic field signal value detected by the magnetic field detector can be triggered and received, and whether the comparison result of the magnetic field signal value and the calibration magnetic field signal value meets the preset condition or not is judged; when the comparison result meets the preset condition, the automatic control sliding mechanism is triggered to slide, the user demand can be accurately detected, the sliding of the sliding mechanism is triggered to be automatically controlled on the time node which is needed by the user most, the user use experience is improved, and the automatic control effect of the sliding mechanism is improved.
It can be understood that, in the embodiment of the present invention, when the first user input or the second user input is received, the user input correspondingly triggers one magnetic field detector to detect one signal value, for example, if the first user input is to start the target application program, the target application program correspondingly invokes the sliding control logic of the sliding mechanism to trigger the sliding mechanism to slide out of the side wall of the electronic device, at this time, the magnetic field detector that detects the magnetic field signal value that controls the sliding mechanism to slide out will compare the magnetic field signal value with the calibration magnetic field signal value, and if the first user input is to exit from the running of the target application program, the target application program correspondingly invokes the sliding control logic of the sliding mechanism to trigger the sliding mechanism to slide into the side wall of the electronic device, at this time, the magnetic field detector that detects the magnetic field signal value that controls the sliding mechanism to slide in will compare the magnetic field signal value with the calibration magnetic field signal value And (6) comparison.
Therefore, in the embodiment of the invention, when the comparison result meets the preset condition, the magnetic field detector with the comparison result meeting the preset condition is used as the target magnetic field detector, and then the sliding-out or sliding-in of the target detector is triggered to be automatically controlled, so that the sliding intelligence and the scientific and technological sense of the sliding mechanism can be enhanced, and the use experience of a user is improved.
In view of the above, in the process that the sliding mechanism slides out of the side wall of the body upwards, if the magnetic field signal value is smaller than the calibration magnetic field signal value corresponding to the first magnetic field detector, determining the first magnetic field detector as a target magnetic field detector, and automatically controlling the sliding mechanism to slide to protrude out of the side wall of the body; and in the process that the sliding mechanism slides downwards into the side wall of the body, if the magnetic field signal value is smaller than the calibration magnetic field signal value corresponding to the second magnetic field detector, determining the second magnetic field detector as a target magnetic field detector, and automatically controlling the sliding mechanism to slide so as to be positioned in the body.
In this embodiment, whether the comparison result of the magnetic field signal value and the calibration magnetic field signal value meets the preset condition is judged, and when the comparison result meets the preset condition, the sliding mechanism is triggered to automatically control to slide, so that the sliding mechanism on the electronic device can be more simply, conveniently and efficiently controlled to slide in and out, and the automation of the sliding control of the sliding mechanism is improved.
Fig. 5 is a schematic structural diagram of a control device of a sliding mechanism according to an embodiment of the present invention.
Referring to fig. 5, the control device 50 of the sliding mechanism is applied to the electronic device as shown in fig. 2, the electronic device includes a body and a sliding mechanism, the body is provided with a magnetic field detector, the sliding mechanism is provided with a magnetic field generating element, the sliding mechanism can move relative to the body to protrude out of the side wall of the body or be located inside the body, the device 50 includes:
the receiving module 501 is configured to receive a magnetic field signal value detected by the magnetic field detector.
The determining module 502 is configured to determine whether a comparison result between the magnetic field signal value and the calibration magnetic field signal value satisfies a preset condition.
And the control module 503 is configured to trigger the automatic sliding mechanism to slide when the comparison result meets a preset condition.
Optionally, in some embodiments, referring to fig. 6, the receiving module 501 includes:
the first receiving submodule 5011 is configured to receive a first user input.
The second receiving submodule 5012 is configured to trigger receiving of the magnetic field signal value detected by the magnetic field detector when the first user input is running the target application in the electronic device.
Optionally, in some embodiments, referring to fig. 7, the receiving module 501 includes:
the third receiving submodule 5013 is configured to receive a second user input.
The fourth receiving submodule 5014 is configured to trigger receiving of the magnetic field signal value detected by the magnetic field detector when the second user input is controlling the sliding mechanism to slide.
Optionally, in some embodiments, referring to fig. 7, further comprising:
a writing module 504, configured to write calibration magnetic field signal values into hardware registers corresponding to the magnetic field detectors, respectively, where the calibration magnetic field signal values are determined through experiments.
Optionally, in some embodiments, the determining module 502 is specifically configured to:
and when the magnetic field signal value is smaller than the calibration magnetic field signal value corresponding to any magnetic field detector, determining that the comparison result meets the preset condition.
Optionally, in some embodiments, the control module 503 is specifically configured to:
determining the time elapsed after the preset condition is met;
and if the elapsed time reaches a preset time threshold, taking the magnetic field detector with the comparison result meeting the preset condition as a target magnetic field detector, and automatically controlling the sliding mechanism to slide based on the target magnetic field detector.
Optionally, in some embodiments, the control module 503 is specifically configured to:
in the process that the sliding mechanism slides out of the side wall of the body upwards, if the magnetic field signal value is smaller than the calibration magnetic field signal value corresponding to the first magnetic field detector, determining the first magnetic field detector as a target magnetic field detector, and automatically controlling the sliding mechanism to slide to protrude out of the side wall of the body;
and in the process that the sliding mechanism slides downwards into the side wall of the body, if the magnetic field signal value is smaller than the calibration magnetic field signal value corresponding to the second magnetic field detector, determining the second magnetic field detector as a target magnetic field detector, and automatically controlling the sliding mechanism to slide so as to be positioned in the body.
Optionally, in some embodiments, the magnetic field detector is a hall element.
It should be noted that the explanation of the embodiment of the control method of the sliding mechanism in the foregoing embodiments of fig. 1 to 4 also applies to the control device 50 of the sliding mechanism in this embodiment, and the implementation principle is similar, and is not described again here.
In this embodiment, whether the comparison result of the magnetic field signal value and the calibration magnetic field signal value meets the preset condition is judged, and when the comparison result meets the preset condition, the sliding mechanism is triggered to automatically control to slide, so that the sliding mechanism on the electronic device can be more simply, conveniently and efficiently controlled to slide in and out, and the automation of the sliding control of the sliding mechanism is improved.
Fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Referring to fig. 8, the electronic device 80 includes: the electronic device 80 comprises a body 801 and a sliding mechanism 802, wherein a magnetic field detector 805 is arranged on the body 801, a magnetic field generating element 806 is arranged on the sliding mechanism 802, the sliding mechanism 802 can move relative to the body 801 to protrude out of the side wall of the body 801 or be positioned in the body 801, and the electronic device 80 further comprises: a memory 803, a processor 804 electrically connected to the sliding mechanism 802, and a computer program stored in the memory 803 and operable on the processor 804, wherein the processor 804 executes the program to implement the method for controlling the sliding mechanism in the embodiments of fig. 1-4.
It should be noted that the foregoing explanation of the embodiment of the control method of the sliding mechanism in the embodiments of fig. 1 to fig. 4 also applies to the electronic device 80 of this embodiment, and the implementation principle is similar and is not described again here.
In this embodiment, whether the comparison result of the magnetic field signal value and the calibration magnetic field signal value meets the preset condition is judged, and when the comparison result meets the preset condition, the sliding mechanism is triggered to automatically control to slide, so that the sliding mechanism on the electronic device can be more simply, conveniently and efficiently controlled to slide in and out, and the automation of the sliding control of the sliding mechanism is improved.
An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the control method of the sliding mechanism according to the foregoing embodiment.
It should be noted that the terms "first," "second," and the like in the description of the present invention are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. In addition, in the description of the present invention, "a plurality" means two or more unless otherwise specified.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and alternate implementations are included within the scope of the preferred embodiment of the present invention in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present invention.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., 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, the schematic representations of the terms used above 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.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.

Claims (14)

1. A control method of a sliding mechanism is applied to electronic equipment, the electronic equipment comprises a body and the sliding mechanism, a magnetic field detector is arranged on the body, a magnetic field generating element is arranged on the sliding mechanism, a camera device is carried on the sliding mechanism, the sliding mechanism can slide relative to the body to protrude out of the side wall of the body or slide into the body, and the control method comprises the following steps:
receiving a magnetic field signal value detected by a magnetic field detector;
judging whether the comparison result of the magnetic field signal value and the calibration magnetic field signal value meets a preset condition or not;
when the comparison result meets the preset condition, triggering to automatically control the sliding mechanism to slide;
the magnetic field detector comprises a first magnetic field detector and a second magnetic field detector, the first magnetic field detector and the second magnetic field detector are arranged on the body in parallel, and before receiving the magnetic field signal value detected by the magnetic field detector, the magnetic field detector further comprises:
respectively writing a calibration magnetic field signal value into a hardware register corresponding to each magnetic field detector, wherein the calibration magnetic field signal value is determined through experiments;
the judging whether the comparison result of the magnetic field signal value and the calibration magnetic field signal value meets a preset condition includes:
and when the magnetic field signal value is smaller than the calibration magnetic field signal value corresponding to any one of the magnetic field detectors, determining that the comparison result meets the preset condition.
2. The method for controlling a sliding mechanism according to claim 1, wherein the receiving the magnetic field signal value detected by the magnetic field detector comprises:
receiving a first user input;
triggering to receive the magnetic field signal value detected by the magnetic field detector when the first user input is that the electronic device runs a target application program.
3. The method for controlling a sliding mechanism according to claim 1, wherein the receiving the magnetic field signal value detected by the magnetic field detector comprises:
receiving a second user input;
and triggering and receiving the magnetic field signal value detected by the magnetic field detector when the second user input is to control the sliding mechanism to slide.
4. The method for controlling the sliding mechanism according to claim 1, wherein the triggering to automatically control the sliding mechanism to slide when the comparison result meets the preset condition includes:
determining the time elapsed after the preset condition is met;
and if the elapsed time reaches a preset time threshold, taking the magnetic field detector with the comparison result meeting the preset condition as a target magnetic field detector, and automatically controlling the sliding mechanism to slide based on the target magnetic field detector.
5. The method for controlling the sliding mechanism according to claim 4, wherein the step of taking the magnetic field detector with the comparison result satisfying the preset condition as a target magnetic field detector and automatically controlling the sliding mechanism to slide based on the target magnetic field detector comprises:
in the process that the sliding mechanism slides out of the side wall of the body upwards, if the magnetic field signal value is smaller than the calibration magnetic field signal value corresponding to the first magnetic field detector, determining the first magnetic field detector as the target magnetic field detector, and automatically controlling the sliding mechanism to slide to protrude out of the side wall of the body;
and in the process that the sliding mechanism slides downwards into the side wall of the body, if the magnetic field signal value is smaller than the calibration magnetic field signal value corresponding to the second magnetic field detector, determining the second magnetic field detector as the target magnetic field detector, and automatically controlling the sliding mechanism to slide to be positioned in the body.
6. The control method of the slide mechanism according to any one of claims 1 to 5, wherein the magnetic field detector is a Hall element.
7. The utility model provides a controlling means of slide mechanism, its characterized in that is applied to electronic equipment, electronic equipment includes body and slide mechanism, be provided with the magnetic field detector on the body, the last magnetic field that is provided with of slide mechanism produces the component, carry on camera device on the slide mechanism, slide mechanism can slide relatively the body to protrusion in the lateral wall of body, perhaps, slide in inside the body, the device includes:
the receiving module is used for receiving the magnetic field signal value detected by the magnetic field detector;
the judging module is used for judging whether the comparison result of the magnetic field signal value and the calibration magnetic field signal value meets a preset condition or not;
the control module is used for triggering the sliding mechanism to automatically control to slide when the comparison result meets the preset condition;
the magnetic field detector includes first magnetic field detector and second magnetic field detector, first magnetic field detector and second magnetic field detector are in parallel arrangement on the body still includes:
a write-in module, configured to write a calibration magnetic field signal value into a hardware register corresponding to each of the magnetic field detectors, where the calibration magnetic field signal value is determined through an experiment;
the judgment module is specifically configured to:
and when the magnetic field signal value is smaller than the calibration magnetic field signal value corresponding to any one of the magnetic field detectors, determining that the comparison result meets the preset condition.
8. The control device of a sliding mechanism according to claim 7, wherein the receiving module comprises:
a first receiving submodule for receiving a first user input;
and the second receiving submodule is used for triggering and receiving the magnetic field signal value detected by the magnetic field detector when the first user input is that the target application program is operated by the electronic equipment.
9. The control device of a sliding mechanism according to claim 7, wherein the receiving module comprises:
a third receiving submodule for receiving a second user input;
and the fourth receiving submodule is used for triggering and receiving the magnetic field signal value detected by the magnetic field detector when the second user input is used for controlling the sliding mechanism to slide.
10. The control device of a sliding mechanism according to claim 7, wherein the control module is specifically configured to:
determining the time elapsed after the preset condition is met;
and if the elapsed time reaches a preset time threshold, taking the magnetic field detector with the comparison result meeting the preset condition as a target magnetic field detector, and automatically controlling the sliding mechanism to slide based on the target magnetic field detector.
11. The control device of a sliding mechanism according to claim 10, wherein the control module is specifically configured to:
in the process that the sliding mechanism slides out of the side wall of the body upwards, if the magnetic field signal value is smaller than the calibration magnetic field signal value corresponding to the first magnetic field detector, determining the first magnetic field detector as the target magnetic field detector, and automatically controlling the sliding mechanism to slide to protrude out of the side wall of the body;
and in the process that the sliding mechanism slides downwards into the side wall of the body, if the magnetic field signal value is smaller than the calibration magnetic field signal value corresponding to the second magnetic field detector, determining the second magnetic field detector as the target magnetic field detector, and automatically controlling the sliding mechanism to slide to be positioned in the body.
12. The control device of the slide mechanism according to any one of claims 7 to 11, wherein the magnetic field detector is a hall element.
13. An electronic device, comprising a body and a sliding mechanism, wherein the body is provided with a magnetic field detector, the sliding mechanism is provided with a magnetic field generating element, the sliding mechanism is movable relative to the body to protrude from a sidewall of the body or be located inside the body, and the electronic device further comprises: a memory, a processor electrically connected to the sliding mechanism, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method of controlling the sliding mechanism according to any one of claims 1 to 6 when executing the program.
14. A computer-readable storage medium on which a computer program is stored, characterized in that the program, when executed by a processor, implements a control method of a sliding mechanism according to any one of claims 1 to 6.
CN201810603655.6A 2018-06-12 2018-06-12 Control method and device for sliding mechanism, electronic device and storage medium Active CN108958370B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810603655.6A CN108958370B (en) 2018-06-12 2018-06-12 Control method and device for sliding mechanism, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810603655.6A CN108958370B (en) 2018-06-12 2018-06-12 Control method and device for sliding mechanism, electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN108958370A CN108958370A (en) 2018-12-07
CN108958370B true CN108958370B (en) 2021-09-24

Family

ID=64488703

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810603655.6A Active CN108958370B (en) 2018-06-12 2018-06-12 Control method and device for sliding mechanism, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN108958370B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112152710B (en) * 2019-06-28 2022-03-22 Oppo广东移动通信有限公司 Data transmission method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN201066424Y (en) * 2007-05-08 2008-05-28 比亚迪股份有限公司 A camera module for mobile phone with automatic focusing function
CN207304639U (en) * 2017-10-12 2018-05-01 深圳市中易通安全芯科技有限公司 A kind of mobile intelligent terminal with safety switching apparatus
CN207354463U (en) * 2017-11-03 2018-05-11 广东欧珀移动通信有限公司 A kind of CCD camera assembly and mobile terminal
CN108111729A (en) * 2017-12-25 2018-06-01 维沃移动通信有限公司 A kind of camera module, control method and mobile terminal

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100630124B1 (en) * 2005-09-09 2006-09-28 삼성전자주식회사 Improvement method of recognizing opening and shutting in sliding type of mobile terminal and the apparatus thereof
KR101982075B1 (en) * 2012-09-28 2019-05-24 엘지이노텍 주식회사 TV apparatus
US10284697B2 (en) * 2014-07-23 2019-05-07 Huawei Technologies Co., Ltd. Terminal device
CN104320508A (en) * 2014-10-27 2015-01-28 广东欧珀移动通信有限公司 Mobile terminal with rotation camera and camera angle control method thereof
CN106713549A (en) * 2017-01-09 2017-05-24 广东欧珀移动通信有限公司 Electronic device
CN107508938B (en) * 2017-09-06 2020-06-12 Oppo广东移动通信有限公司 Camera module and electronic device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN201066424Y (en) * 2007-05-08 2008-05-28 比亚迪股份有限公司 A camera module for mobile phone with automatic focusing function
CN207304639U (en) * 2017-10-12 2018-05-01 深圳市中易通安全芯科技有限公司 A kind of mobile intelligent terminal with safety switching apparatus
CN207354463U (en) * 2017-11-03 2018-05-11 广东欧珀移动通信有限公司 A kind of CCD camera assembly and mobile terminal
CN108111729A (en) * 2017-12-25 2018-06-01 维沃移动通信有限公司 A kind of camera module, control method and mobile terminal

Also Published As

Publication number Publication date
CN108958370A (en) 2018-12-07

Similar Documents

Publication Publication Date Title
US9800798B2 (en) Systems and methods for power optimization for imaging devices with dual cameras
CN107678534B (en) Method for processing event signals and event-based sensor for carrying out said method
EP2637088B1 (en) Information processing apparatus, control method thereof, and program
US8855481B2 (en) Apparatus and method for photographing timer control of a camera of a terminal
US9459789B2 (en) Information processing apparatus and operation method thereof for determining a flick operation of a pointer
US20140071171A1 (en) Pinch-and-zoom, zoom-and-pinch gesture control
EP2889740A1 (en) Method, apparatus and computer program product for zooming and operating screen frame
US9696840B2 (en) Information processing method and electronic device
US10963368B2 (en) Method of testing prototype linked with existing application
US10120452B2 (en) Information processing apparatus for recognizing operation input by gesture of object and control method thereof
CN108829461A (en) Camera starts control method, device and electronic equipment
CN108958370B (en) Control method and device for sliding mechanism, electronic device and storage medium
US20180300036A1 (en) Drop Zone Prediction for User Input Operations
KR20220062400A (en) Projection method and system
CN103399959A (en) Display method of interactive control of webpage and terminal
CN105786341B (en) Method and device for controlling application program of mobile terminal
EP3675486A1 (en) Control device, industrial automation system, method of controlling control device, program, and non-transitory computer-readable storage medium
EP3007053A1 (en) Information processing device, processing method therefor, and program
EP3800536A1 (en) Method and apparatus for setting interface of mobile terminal system, medium, and device
US20180204071A1 (en) Information processing apparatus, information processing method, and recording medium
US10115204B2 (en) Method and apparatus for predicting eye position
CN108475166B (en) Information processing apparatus, control method therefor, and program
US9684355B2 (en) Identifying power state changes
CN110032323B (en) Electronic equipment and gesture navigation method
CN107977294B (en) Method and device for monitoring temperature of electronic element

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