CN108845871B - Method and device for calling device in electronic equipment, electronic equipment and storage medium - Google Patents

Method and device for calling device in electronic equipment, electronic equipment and storage medium Download PDF

Info

Publication number
CN108845871B
CN108845871B CN201810588785.7A CN201810588785A CN108845871B CN 108845871 B CN108845871 B CN 108845871B CN 201810588785 A CN201810588785 A CN 201810588785A CN 108845871 B CN108845871 B CN 108845871B
Authority
CN
China
Prior art keywords
distance
sliding mechanism
state
sliding
current
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
CN201810588785.7A
Other languages
Chinese (zh)
Other versions
CN108845871A (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 CN201810588785.7A priority Critical patent/CN108845871B/en
Publication of CN108845871A publication Critical patent/CN108845871A/en
Application granted granted Critical
Publication of CN108845871B publication Critical patent/CN108845871B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Selective Calling Equipment (AREA)
  • Telephone Function (AREA)

Abstract

The invention provides a device calling method and device in electronic equipment, the electronic equipment and a storage medium, wherein the electronic equipment comprises a body and a sliding mechanism, the sliding mechanism carries a device, the sliding mechanism can move relative to the body to protrude out of the side wall of the body or be positioned in the body, the method comprises the steps of running a target application program on the foreground of the electronic equipment and triggering the sliding mechanism associated with the target application program to slide out to protrude out of the side wall of the body; monitoring whether the current visible state of a device carried on the sliding mechanism is a preset state or not; and when the current visual state is not the preset state, triggering the target application program to call the device carried by the associated sliding mechanism. The invention can realize that the device carried on the sliding mechanism is triggered to be called when the device is in a proper state, and effectively avoids the influence of the energy generated by the device on the electronic equipment.

Description

Method and device for calling device in electronic equipment, electronic equipment 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 calling a device in an electronic device, and a storage medium.
Background
In order to improve user experience, the screen of the electronic device occupies a larger area, and even a full-screen design has been proposed, so how to trigger and call devices (such as a camera and a flash lamp) at a proper time 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 device invoking method in an electronic apparatus, which can trigger invoking of a device mounted on a sliding mechanism when the device is in a suitable state, and effectively avoid the influence of energy generated by the device on the electronic apparatus.
Another object of the present invention is to provide a device calling apparatus in an electronic device.
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, an embodiment of the present invention provides a method for calling a device in an electronic device, where the electronic device includes a body and a sliding mechanism, the sliding mechanism is mounted with the device, 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 the method includes: running a target application program on the foreground of the electronic equipment, and triggering a sliding mechanism associated with the target application program to slide out to protrude out of the side wall of the body; monitoring whether the current visible state of the device carried on the sliding mechanism is a preset state or not; and when the current visual state is not the preset state, triggering the target application program to call the device carried by the associated sliding mechanism.
According to the device calling method in the electronic equipment provided by the embodiment of the first aspect of the invention, whether the current visual state of the device carried on the sliding mechanism is the preset state or not is monitored when the target application program runs on the electronic equipment, and when the current visual state is not the preset state, the target application program is triggered to call the related device carried on the sliding mechanism, so that the device carried on the sliding mechanism can be triggered to be called when the device is in the proper state, and the influence of energy generated by the device on the electronic equipment is effectively avoided.
In order to achieve the above object, a device invoking apparatus in an electronic device according to an embodiment of a second aspect of the present invention is applied to an electronic device, where the electronic device includes a body and a sliding mechanism, the sliding mechanism is mounted with the device, 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 running module is used for running a target application program on the foreground of the electronic equipment and triggering a sliding mechanism associated with the target application program to slide out to protrude out of the side wall of the body; the monitoring module is used for monitoring whether the current visible state of the device carried on the sliding mechanism is a preset state or not; and the control module is used for triggering the target application program to call the device carried by the associated sliding mechanism when the current visual state is not the preset state.
According to the device calling device in the electronic equipment provided by the embodiment of the second aspect of the invention, whether the current visual state of the device carried on the sliding mechanism is the preset state or not is monitored when the target application program runs on the electronic equipment, and when the current visual state is not the preset state, the target application program is triggered to call the related device carried on the sliding mechanism, so that the device carried on the sliding mechanism can be triggered to be called when the device is in the proper state, and the influence of energy generated by the device on the electronic equipment is effectively avoided.
In order to achieve the above object, an electronic apparatus according to a third aspect of the present invention includes a main body, and a slide mechanism, the component being mounted on the slide mechanism, the slide mechanism being movable relative to the main body so as to protrude from a side wall of the main body or be located inside the main body, the electronic apparatus further including: the device calling 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 device calling method in the electronic equipment provided by the embodiment of the first aspect of the invention is realized.
According to the electronic equipment provided by the embodiment of the third aspect of the invention, when the target application program runs on the electronic equipment, whether the current visual state of the device carried on the sliding mechanism is the preset state or not is monitored, and when the current visual state is not the preset state, the calling of the target application program to the associated device carried on the sliding mechanism is triggered, so that the device carried on the sliding mechanism can be triggered to be called when the device is in the proper state, and the influence of energy generated by the device on the electronic equipment is effectively avoided.
To achieve the above object, a computer-readable storage medium according to a fourth embodiment of the present invention is a computer program stored thereon, where the computer program is configured to, when executed by a processor, implement a device invoking method in an electronic device 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, when a target application program runs on the electronic equipment, whether the current visual state of a device carried on the sliding mechanism is a preset state is monitored, and when the current visual state is not the preset state, the target application program is triggered to call the associated device carried on the sliding mechanism, so that the device carried on the sliding mechanism can be triggered to be called when the device is in a proper state, and the influence of energy generated by the device on the electronic equipment is effectively avoided.
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 device calling method in an electronic device 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 structural diagram of another electronic device in an embodiment of the invention;
fig. 4 is a flowchart illustrating a device calling method in an electronic device according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a device calling apparatus in an electronic device according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a device calling apparatus in an electronic device according to another embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to an 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 device calling method in an electronic device according to an embodiment of the present invention.
The present embodiment is exemplified in a case where the device calling method in the electronic apparatus is configured as a device calling apparatus in the electronic apparatus.
The device calling method in the electronic device in this embodiment may be configured in a device calling apparatus in the electronic device, and the device calling apparatus in the electronic device may be set in the electronic device, which is not limited in this embodiment of the present invention.
The embodiment takes the case that the device calling method in the electronic equipment is configured in the electronic equipment as an example.
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 of the electronic device occupies a larger area, and even a full-screen design has been proposed, so how to trigger and call devices (such as a camera and a flash lamp) at a proper time becomes a problem to be solved urgently.
Therefore, the embodiment of the invention provides a device calling method in electronic equipment, which monitors whether the current visual state of a device carried on a sliding mechanism is a preset state or not when a target application program runs on the electronic equipment, and triggers the target application program to call the device carried on the associated sliding mechanism when the current visual state is not the preset state, so that the device carried on the sliding mechanism can be triggered to be called when the device is in a proper state, and the influence of energy generated by the device on the electronic equipment is effectively avoided.
Referring to fig. 2 and fig. 3 together, the electronic device 200 in the embodiment of the invention includes a main body 201 and a sliding mechanism 202, the device 2021 is mounted 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 be located inside the main body 201. The electronic device 200 further includes a detection unit 30, the detection unit includes a magnetic field generating element 32 and a magnetic field detector 34, and the magnetic field generating element 32 and the magnetic field detector 34 are respectively fixed to the body 201 and the sliding mechanism 202.
Referring to fig. 1, the method includes:
s101: and running the target application program on the foreground of the electronic equipment, and triggering a sliding mechanism associated with the target application program to slide out to protrude out of the side wall of the body.
Optionally, the target application is a photo-like program or a flashlight-like program and the device is a flash.
In the specific execution process, when the target application program runs on the electronic device, the sliding mechanism related to calling the target application program can be triggered to slide out to protrude out of the side wall of the body so as to normally work, or the calling of the sliding mechanism can be released so as to be accommodated in the body.
Compared with the prior art that the slide mechanism is triggered to slide out, namely the device mounted on the slide mechanism is called, the embodiment of the invention executes the following steps to determine whether the device mounted on the slide mechanism is in a proper state or not in the process of triggering the slide mechanism associated with the target application program to slide out.
S102: and monitoring whether the current visible state of the device carried on the sliding mechanism is a preset state or not.
Optionally, the predetermined state is a hidden state in which the device is completely hidden in a sidewall of the electronic device.
In the specific execution process, whether the current visible state of the device is the preset state or not can be determined according to the linear distance between the device and the side wall of the body and the current sliding distance of the sliding mechanism in the sliding process, the algorithm is simple to execute, extra hardware resource cost is not required to be consumed, and the judgment accuracy is high.
Referring specifically to fig. 4, S102 may include:
s401: a linear distance between the device and the sidewall of the body is determined and taken as the first distance.
Referring to fig. 2, the sliding mechanism 202 is configured to slide between a first position accommodated in the body 201 and a second position exposed from the body 201.
The embodiment of the present invention shown in fig. 4 can be applied to the process of sliding the sliding mechanism from the first position to the second position, or can also be applied to the process of sliding from the second position to the first position, which is not limited to this.
The present embodiment exemplifies that a linear distance between the device and the side wall of the body is determined in the process of sliding the sliding mechanism from the first position to the second position.
S402: and determining the current sliding distance of the sliding mechanism in the sliding process as the second distance.
Optionally, the second distance comprises: a second distance based on the first direction, the first direction being a direction of sliding from the first position to the second position, and a second distance based on the second direction, the second direction being a direction of sliding from the second position to the first position, the first distance including: the device is arranged in the body and is a first distance away from the side wall of the body when the device is arranged in the body, and the device is arranged in the body and is a first distance away from the side wall of the body when the device is exposed out of the body.
It can be understood that, since the device is mounted on the sliding mechanism and the size of the device is generally smaller than that of the sliding mechanism, when the sliding mechanism mounts the device in the first position and is about to slide to the second position (at this time, the device is completely hidden in the side wall of the electronic device), the device in the first position has a linear distance from the side wall where the device is about to slide out, and the linear distance may be referred to as a first distance, and when the sliding mechanism mounts the device in the sliding mechanism, the value of the first distance becomes smaller as the sliding process progresses (during the sliding from the first position to the second position).
Therefore, in the specific implementation process of the embodiment of the present invention, in the process of triggering the sliding mechanism associated with the target application to slide out, the linear distance between the device and the side wall of the body is determined in real time and is taken as the first distance, then in the sliding process, the current sliding distance of the sliding mechanism in the sliding process is determined in real time and is taken as the second distance, since the device is mounted on the sliding mechanism, the current sliding distance of the sliding mechanism, that is, the current sliding distance of the device, is determined, and in the process of sliding the sliding mechanism mounted device from the first position to the second position, the device is gradually exposed along with sliding from a state completely hidden in the side wall of the electronic device, after determining the first distance and the second distance, the triggering according to the first distance and the second distance is performed, and monitoring whether the current visible state of the device carried on the sliding mechanism is a preset state or not.
In some other embodiments, the electronic device further includes a detection assembly, the detection assembly includes a magnetic field generating element and a magnetic field detector, the magnetic field generating element and the magnetic field detector are respectively fixed on the body and the sliding mechanism, and the current sliding distance of the sliding mechanism in the sliding process can be determined in a manner of receiving a signal value detected by the magnetic field generated by the magnetic field generating element by the magnetic field detector; determining the current relative position of the sliding mechanism relative to the body according to the signal value; and determining the current sliding distance according to the current relative position and the first position/the second position.
The method comprises the steps that the current sliding distance is determined according to the current relative position and the first position in the process that the sliding mechanism carrying device slides from the first position to the second position, and the current sliding distance is determined according to the current relative position and the second position in the process that the sliding mechanism carrying device slides from the second position to the first position.
The principle of monitoring the current relative position of the sliding mechanism with respect to the body in the embodiment of the present invention is mainly based on the characteristics of a magnetic field detector (the magnetic field detector is, for example, a hall element), that is, the magnetic field detector can sense the magnetic field generated by the magnetic field generating element and output a corresponding signal according to the sensed magnetic induction intensity. Since the magnetic induction is related to the relative position between the magnetic field detector and the magnetic field generating element, the current relative position of the sliding mechanism with respect to the body can be determined by the signal value detected by the magnetic field detector for the magnetic field generated by the magnetic field generating element. In addition, in the embodiment of the present invention, the magnetic field generating element and the magnetic field detector may be configured to be fixed to the body and the sliding mechanism, respectively, and the magnetic field generating element and the magnetic field detector may generate relative movement with the movement of the sliding mechanism, so that the current relative position of the sliding mechanism with respect to the body may be indirectly determined by determining the relative position of the magnetic field detector and the magnetic field generating element.
In some other embodiments of the present invention, the calibration relative position corresponding to the signal value may be further queried from a query database as the current relative position, where the query database includes a plurality of preset signal values and a plurality of calibration relative positions, and each preset signal value corresponds to one calibration relative position.
It will be appreciated that since each preset signal value corresponds to a nominal relative position, that is, each preset signal value corresponds to one and only one corresponding nominal relative position. In this manner, data associated with the detected signal values may be read in the query database based on the detected signal values, thereby enabling determination of the current relative position based on the detected signal values.
In other embodiments of the present invention, the data in the query database is obtained by detecting in advance according to the test data, or may also be obtained by learning the mass data in the cloud server by using a big data technology, and in a manner obtained by detecting in advance according to the test data, the sliding mechanism may specifically be slid to a plurality of calibrated relative positions in advance; acquiring output signal values detected by the magnetic field detector based on the corresponding calibration relative positions, and taking each signal value as a preset signal value of the corresponding calibration relative position; and generating a corresponding relation between each calibration relative position and the corresponding preset signal value, and storing the corresponding relation into an inquiry database.
In the embodiment of the invention, the corresponding relation between the position of the sliding mechanism and the signal value detected by the magnetic field detector can be obtained by recording a plurality of calibration relative positions and the signal value detected by the magnetic field detector at each calibration relative position. In this way, in the subsequent process of determining the current relative position, as long as the signal value detected by the magnetic field detector is obtained, the current relative position can be reversely deduced through the corresponding relation determined by the method.
In the specific implementation process of the embodiment of the invention, a plurality of preset signal values and a plurality of calibration relative positions can be associated to form a lookup table or fitted to form a relationship curve.
The embodiment of the invention is convenient to store and query, and simultaneously ensures that the corresponding relation between the calibrated relative position of the sliding mechanism and the signal value output by the magnetic field detector and used as the preset signal value is more accurate. It can be understood that, in the actual detection process, the sliding mechanism does not necessarily just slide to the calibrated relative position, but may slide between two calibrated relative positions, and at this time, it is not accurate to directly use the preset signal value corresponding to the calibrated relative position.
Therefore, in the embodiment of the present invention, the current relative position of the sliding mechanism may also be calculated by using an average value of the two calibrated relative positions or by combining the two calibrated relative positions according to a weight.
Further, in the embodiment of the present invention, it is also considered that the preset signal value does not necessarily change linearly, and a relationship curve may be fitted to the plurality of preset signal values and the plurality of calibration relative positions. In this way, the accuracy of the current relative position determined from the plurality of preset signal values and the plurality of calibrated relative positions can be ensured as much as possible.
S403: and monitoring whether the current visual state of the device carried on the sliding mechanism is a preset state or not according to the first distance and the second distance.
In the process of executing S403, in the embodiment of the present invention, the second distance is: the first distance is, when the second distance is based on the first direction: when the device is located inside the body, the first distance between the device and the side wall of the body can determine that the current visible state of the carried device is a hidden state when the second distance is smaller than or equal to the first distance.
It is understood that, in this case, if the second distance is smaller than or equal to the first distance, it indicates that the sliding mechanism carrying device slides by a distance smaller than or equal to a distance between the device and the side wall of the main body when the device is located inside the main body at the time of the sliding, and therefore, the current visible state of the device at this time is a hidden state.
In the process of executing S403, in the embodiment of the present invention, the second distance is: the first distance is, based on the second distance in the second direction: when the device exposes the body, according to first distance and second distance with the first distance between the lateral wall of body, the current visual state of the device that carries on the monitoring slide mechanism is for predetermineeing the state, include: and when the second distance is greater than or equal to the first distance, determining that the current visible state of the carried device is a hidden state.
It is understood that, in this case, if the second distance is greater than or equal to the first distance, it indicates that the sliding mechanism mounting device slides by a distance greater than or equal to a distance between the device and the side wall of the main body when the device is exposed from the main body at the time of the sliding, and therefore the current visible state of the device at this time is the hidden state.
S103: and when the current visual state is not the preset state, triggering the target application program to call the device carried by the associated sliding mechanism.
In the specific execution process, when the current visible state is not the hidden state, the calling of the device carried by the associated sliding mechanism by the target application program is triggered, the device carried by the sliding mechanism can be triggered to be called when the device is in the appropriate state, and when the current visible state is the hidden state, the device is not triggered to be called, so that the influence of energy generated when the device is called in the side wall of the electronic equipment is effectively avoided.
In this embodiment, when the target application program runs on the electronic device, whether the current visual state of the device mounted on the sliding mechanism is the preset state is monitored, and when the current visual state is not the preset state, the target application program is triggered to call the device mounted on the associated sliding mechanism, so that the device mounted on the sliding mechanism can be triggered to be called when the device is in the proper state, and the influence of energy generated by the device on the electronic device is effectively avoided.
Fig. 5 is a schematic structural diagram of a device calling apparatus in an electronic device according to an embodiment of the present invention.
Referring to fig. 5, the apparatus is applied to the electronic device as shown in fig. 2, the electronic device includes a body and a sliding mechanism, the sliding mechanism carries the device thereon, the sliding mechanism can move relative to the body to protrude from the side wall of the body or be located inside the body, the apparatus 50 includes:
the running module 501 is configured to run a target application on the foreground of the electronic device, and trigger a sliding mechanism associated with the target application to slide out to protrude from a sidewall of the body.
The monitoring module 502 is configured to monitor whether a current visible state of a device mounted on the sliding mechanism is a preset state.
And the control module 503 is configured to trigger the target application to call the device mounted on the associated sliding mechanism when the current visual state is not the preset state.
Optionally, in some embodiments, referring to fig. 6, the monitoring module 502 includes:
the first determining submodule 5021 is used for determining a linear distance between the device and the side wall of the body and is used as a first distance.
The second determining sub-module 5022 is used for determining the current sliding distance of the sliding mechanism during sliding and is used as the second distance.
And the monitoring submodule 5023 is used for monitoring whether the current visible state of the device carried on the sliding mechanism is a preset state or not according to the first distance and the second distance.
It should be noted that the explanation of the embodiment of the device calling method in the electronic equipment in the foregoing fig. 1 to fig. 4 is also applicable to the device calling apparatus 50 in the electronic equipment of this embodiment, and the implementation principle is similar, and is not described herein again.
In this embodiment, when the target application program runs on the electronic device, whether the current visual state of the device mounted on the sliding mechanism is the preset state is monitored, and when the current visual state is not the preset state, the target application program is triggered to call the device mounted on the associated sliding mechanism, so that the device mounted on the sliding mechanism can be triggered to be called when the device is in the proper state, and the influence of energy generated by the device on the electronic device is effectively avoided.
Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Referring to fig. 7, the electronic device 70 includes: the electronic device 70 includes a main body 701 and a sliding mechanism 702, the sliding mechanism 702 is mounted with a device 7021, the sliding mechanism 702 can move relative to the main body 701 to protrude from a sidewall of the main body 701, or is located inside the main body 701, and the electronic device 70 further includes: the memory 703, the processor 704 electrically connected to the sliding mechanism 702, and a computer program stored in the memory 703 and operable on the processor 704, when the processor 704 executes the program, implement the device calling method in the electronic device in the embodiments of fig. 1-4.
Optionally, in some embodiments, referring to fig. 8, the sliding mechanism 702 is configured to slide between a first position a housed in the body 701 and a second position B exposed from the body 701, the electronic device 70 further includes a detection component 705, the detection component 705 includes a magnetic field generating element 7051 and a magnetic field detector 7052, the magnetic field generating element 7051 and the magnetic field detector 7052 are respectively fixed to the body 701 and the sliding mechanism 702, and the processor 704 is further configured to:
determining a linear distance between the device and the side wall of the body as a first distance;
determining the current sliding distance of the sliding mechanism in the sliding process and taking the current sliding distance as a second distance;
and monitoring whether the current visual state of the device carried on the sliding mechanism is a preset state or not according to the first distance and the second distance.
Optionally, in some embodiments, the memory 703 and the processor 704 are disposed on the motherboard 706 inside the body 701; the main board 706 is fixedly connected with the body 701;
the magnetic field generating element 7051 is disposed on the sliding mechanism 702, and the magnetic field detector 7052 is disposed on the main board 706; alternatively, the magnetic field generating element 7051 is provided on the main board 706, and the magnetic field detector 7052 is provided on the sliding mechanism 702.
Alternatively, in some embodiments, the magnetic field detector 7052 is embodied as a hall element.
Optionally, in some embodiments, the target application is a photo-type program or a flashlight-type program and the device is a flash.
It should be noted that the explanation of the embodiment of the device calling method in the electronic device in the foregoing embodiments of fig. 1 to fig. 4 also applies to the electronic device 70 of this embodiment, and the implementation principle is similar, and is not described again here.
In this embodiment, when the target application program runs on the electronic device, whether the current visual state of the device mounted on the sliding mechanism is the preset state is monitored, and when the current visual state is not the preset state, the target application program is triggered to call the device mounted on the associated sliding mechanism, so that the device mounted on the sliding mechanism can be triggered to be called when the device is in the proper state, and the influence of energy generated by the device on the electronic device is effectively avoided.
Embodiments of the present invention also provide a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a device calling method in an electronic device according to the foregoing embodiments.
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 (13)

1. A method for calling a device in electronic equipment, wherein the electronic equipment comprises a body and a sliding mechanism, the device is carried on the sliding mechanism, and the sliding mechanism can move relative to the body to protrude out of a side wall of the body or be located inside the body, and the method comprises the following steps:
running a target application program on the foreground of the electronic equipment, and triggering a sliding mechanism associated with the target application program to slide out to protrude out of the side wall of the body;
monitoring whether the current visible state of the device carried on the sliding mechanism is a preset state or not; the preset state is a hidden state, and the device is completely hidden in the side wall of the electronic equipment in the hidden state;
when the current visual state is not the preset state, triggering the target application program to call the device carried by the associated sliding mechanism;
the monitoring slide mechanism goes up the current visual state of carrying on the device whether for predetermineeing the state, include:
determining a linear distance between the device and a sidewall of the body as a first distance, the first distance comprising: the device is arranged in the body and is a first distance away from the side wall of the body when the device is arranged in the body, and the device is arranged in the body and is a first distance away from the side wall of the body when the device is exposed out of the body;
determining the current sliding distance of the sliding mechanism in the sliding process and taking the current sliding distance as a second distance;
and monitoring whether the current visible state of the device carried on the sliding mechanism is a preset state or not according to the first distance and the second distance.
2. The method for calling up a device in an electronic apparatus according to claim 1, wherein the sliding mechanism is configured to slide between a first position housed in the body and a second position exposed from the body, the electronic apparatus further includes a detection component, the detection component includes a magnetic field generating element and a magnetic field detector, the magnetic field generating element and the magnetic field detector are respectively fixed to the body and the sliding mechanism, and the determining a current sliding distance of the sliding mechanism during the sliding process and the current sliding distance serve as a second distance includes:
receiving a signal value detected by the magnetic field detector for the magnetic field generated by the magnetic field generating element;
determining a current relative position of the sliding mechanism relative to the body according to the signal value;
determining the current sliding distance according to the current relative position and the first position/the second position.
3. The device call method in an electronic apparatus according to claim 2, wherein the preset state is a hidden state, and the second distance includes: a second distance based on a first direction, which is a direction of sliding from the first position to the second position, and a second distance based on a second direction, which is a direction of sliding from the second position to the first position.
4. A device call method in an electronic apparatus according to claim 3, wherein at the second distance: a second distance based on the first direction, the first distance being: a first distance from a sidewall of the body when the device is inside the body,
according to the first distance and the second distance, whether the current visual state of the device carried on the sliding mechanism is a preset state or not is monitored, and the method comprises the following steps:
and when the second distance is smaller than or equal to the first distance, determining that the current visible state of the carried device is the hidden state.
5. A device call method in an electronic apparatus according to claim 3, wherein at the second distance: a second distance based on a second direction, the first distance being: a first distance from a sidewall of the body when the device is exposed from the body,
according to the first distance and the second distance, whether the current visual state of the device carried on the sliding mechanism is a preset state or not is monitored, and the method comprises the following steps:
and when the second distance is greater than or equal to the first distance, determining that the current visible state of the carried device is the hidden state.
6. The device calling method in the electronic equipment as claimed in any one of claims 1 to 5, wherein the target application is a photo-like program or a flashlight-like program and the device is a flash lamp.
7. A device calling device in an electronic device is applied to the electronic device, the electronic device comprises a body and a sliding mechanism, the device is carried on the sliding mechanism, 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, and the device comprises:
the running module is used for running a target application program on the foreground of the electronic equipment and triggering a sliding mechanism associated with the target application program to slide out to protrude out of the side wall of the body;
the monitoring module is used for monitoring whether the current visible state of the device carried on the sliding mechanism is a preset state or not; the preset state is a hidden state, and the device is completely hidden in the side wall of the electronic equipment in the hidden state;
the control module is used for triggering the target application program to call the device carried by the associated sliding mechanism when the current visual state is not the preset state;
the monitoring module includes:
a first determining submodule for determining a linear distance between the device and a sidewall of the body as a first distance, the first distance comprising: the device is arranged in the body and is a first distance away from the side wall of the body when the device is arranged in the body, and the device is arranged in the body and is a first distance away from the side wall of the body when the device is exposed out of the body;
the second determining submodule is used for determining the current sliding distance of the sliding mechanism in the sliding process and taking the current sliding distance as a second distance;
and the monitoring submodule is used for monitoring whether the current visible state of the device carried on the sliding mechanism is a preset state or not according to the first distance and the second distance.
8. An electronic device, comprising a body and a sliding mechanism, wherein the sliding mechanism carries a device thereon, and the sliding mechanism is movable relative to the body to protrude from a sidewall of the body or be located inside the body, the electronic device further comprising: 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 device calling method in the electronic apparatus according to any one of claims 1 to 6 when executing the program.
9. The electronic device of claim 8, wherein the sliding mechanism is configured to slide between a first position housed in the body and a second position exposed from the body, the electronic device further comprises a detection assembly, the detection assembly comprises a magnetic field generating element and a magnetic field detector, the magnetic field generating element and the magnetic field detector are respectively fixed to the body and the sliding mechanism, and the processor is further configured to perform:
determining a linear distance between the device and a side wall of the body as a first distance;
determining the current sliding distance of the sliding mechanism in the sliding process and taking the current sliding distance as a second distance;
and monitoring whether the current visible state of the device carried on the sliding mechanism is a preset state or not according to the first distance and the second distance.
10. The electronic device of claim 9, wherein the memory and the processor are disposed on a motherboard inside the body; the main board is fixedly connected with the body;
the magnetic field generating element is arranged on the sliding mechanism, and the magnetic field detector is arranged on the main board; or, the magnetic field generating element is disposed on the main board, and the magnetic field detector is disposed on the sliding mechanism.
11. Electronic device according to claim 10, characterized in that the magnetic field detector is embodied as a hall element.
12. The electronic device of any of claims 8-11, wherein the target application is a photo-like program or a flashlight-like program and the device is a flash.
13. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, is adapted to carry out a device invocation method in an electronic equipment according to any one of claims 1-6.
CN201810588785.7A 2018-06-08 2018-06-08 Method and device for calling device in electronic equipment, electronic equipment and storage medium Active CN108845871B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810588785.7A CN108845871B (en) 2018-06-08 2018-06-08 Method and device for calling device in electronic equipment, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810588785.7A CN108845871B (en) 2018-06-08 2018-06-08 Method and device for calling device in electronic equipment, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN108845871A CN108845871A (en) 2018-11-20
CN108845871B true CN108845871B (en) 2021-01-01

Family

ID=64210786

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810588785.7A Active CN108845871B (en) 2018-06-08 2018-06-08 Method and device for calling device in electronic equipment, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN108845871B (en)

Families Citing this family (2)

* 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
CN112152723B (en) * 2019-06-28 2022-08-02 Oppo广东移动通信有限公司 Mobile terminal

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103546687A (en) * 2013-07-31 2014-01-29 Tcl数码科技(深圳)有限责任公司 Vertically scalable camera and electronic device
CN105187700A (en) * 2015-09-08 2015-12-23 小米科技有限责任公司 Automatic camera pop-up device and terminal
CN107197133A (en) * 2017-07-21 2017-09-22 维沃移动通信有限公司 A kind of mobile terminal and CCD camera assembly
CN107819907A (en) * 2017-11-14 2018-03-20 维沃移动通信有限公司 A kind of camera control method and mobile terminal
CN207304642U (en) * 2017-10-19 2018-05-01 李雪峰 Integral intelligent mobile terminal based on concealed sensor

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9762781B2 (en) * 2015-10-30 2017-09-12 Essential Products, Inc. Apparatus and method to maximize the display area of a mobile device by increasing the size of the display without necessarily increasing the size of the phone

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103546687A (en) * 2013-07-31 2014-01-29 Tcl数码科技(深圳)有限责任公司 Vertically scalable camera and electronic device
CN105187700A (en) * 2015-09-08 2015-12-23 小米科技有限责任公司 Automatic camera pop-up device and terminal
CN107197133A (en) * 2017-07-21 2017-09-22 维沃移动通信有限公司 A kind of mobile terminal and CCD camera assembly
CN207304642U (en) * 2017-10-19 2018-05-01 李雪峰 Integral intelligent mobile terminal based on concealed sensor
CN107819907A (en) * 2017-11-14 2018-03-20 维沃移动通信有限公司 A kind of camera control method and mobile terminal

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于触觉反馈的虚拟变形与切割研究;陈飞;《中国优秀硕士学位论文全文数据库 信息科技辑》;20111215(第S2期);论文第15-16页 *

Also Published As

Publication number Publication date
CN108845871A (en) 2018-11-20

Similar Documents

Publication Publication Date Title
EP2821897B1 (en) Finger detection on touch screens for mobile devices
CN107302661B (en) A kind of camera control method and mobile terminal
JP6380875B2 (en) Detection distance calibration method, apparatus, and device
CN108845871B (en) Method and device for calling device in electronic equipment, electronic equipment and storage medium
US10477115B2 (en) Method for measuring ambient brightness value and photographing device
CN105866781B (en) Data processing method and electronic equipment
US7904272B2 (en) System and method for calculating coordinate values of a measuring machine
CN105890624B (en) Calibration method and electronic equipment
CN108833623B (en) Sliding control method and device of sliding assembly and electronic device
WO2016140751A1 (en) Display interaction detection
CN108369467B (en) Method and apparatus for sensing pressure applied to a screen using at least one sensor device
US20180341363A1 (en) Hybrid baseline management
JP2018524777A5 (en)
EP4047841A1 (en) Method for measuring sensing range of vehicle, apparatus and medium
US8762792B2 (en) Event monitor having switch matrix, separate counter, and compare circuitry
US20150293598A1 (en) Method for processing information and electronic device
JP6317519B2 (en) Method and apparatus for realizing cooling of a cooling fan of a projector device
US20190092339A1 (en) Signal processing system and signal processing method for sensors of vehicle
CN109884650B (en) Ultrasonic radar detection method and device, electronic device and storage medium
CN104215966A (en) Terminal ranging method
CN110456271A (en) Detection method, device, equipment and the storage medium of motor hall signal
CN108958370B (en) Control method and device for sliding mechanism, electronic device and storage medium
CN106254661B (en) A kind of data processing method of proximity sensor, device and mobile terminal
US9830242B2 (en) Loading calculation method and loading calculation system for processor in electronic device
WO2016018330A1 (en) Accurately positioning instruments

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