CN108810203B - Control method and device of sliding mechanism and electronic equipment - Google Patents

Control method and device of sliding mechanism and electronic equipment Download PDF

Info

Publication number
CN108810203B
CN108810203B CN201810601782.2A CN201810601782A CN108810203B CN 108810203 B CN108810203 B CN 108810203B CN 201810601782 A CN201810601782 A CN 201810601782A CN 108810203 B CN108810203 B CN 108810203B
Authority
CN
China
Prior art keywords
sliding mechanism
control
state
supplement lamp
light supplement
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
CN201810601782.2A
Other languages
Chinese (zh)
Other versions
CN108810203A (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 CN201810601782.2A priority Critical patent/CN108810203B/en
Publication of CN108810203A publication Critical patent/CN108810203A/en
Application granted granted Critical
Publication of CN108810203B publication Critical patent/CN108810203B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/02Constructional features of telephone sets
    • H04M1/0202Portable telephone sets, e.g. cordless phones, mobile phones or bar type handsets
    • H04M1/0206Portable telephones comprising a plurality of mechanically joined movable body parts, e.g. hinged housings
    • H04M1/0208Portable telephones comprising a plurality of mechanically joined movable body parts, e.g. hinged housings characterized by the relative motions of the body parts
    • H04M1/0235Slidable or telescopic telephones, i.e. with a relative translation movement of the body parts; Telephones using a combination of translation and other relative motions of the body parts
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/02Constructional features of telephone sets
    • H04M1/0202Portable telephone sets, e.g. cordless phones, mobile phones or bar type handsets
    • H04M1/026Details of the structure or mounting of specific components
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/02Constructional features of telephone sets
    • H04M1/0202Portable telephone sets, e.g. cordless phones, mobile phones or bar type handsets
    • H04M1/026Details of the structure or mounting of specific components
    • H04M1/0264Details of the structure or mounting of specific components for a camera module assembly
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Human Computer Interaction (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Studio Devices (AREA)
  • Circuit Arrangement For Electric Light Sources In General (AREA)

Abstract

The invention provides a control method and a control device of a sliding mechanism and electronic equipment, wherein the method is applied to the electronic equipment, the electronic equipment comprises a body and the sliding mechanism provided with a light supplement lamp, the sliding mechanism can move relative to the body to protrude out of the body or be accommodated in the body, and the method comprises the following steps: monitoring the calling of each target interface used for controlling the light supplement lamp, determining a corresponding control strategy according to the called target interface, performing sliding control on the sliding mechanism provided with the light supplement lamp by adopting the control strategy, determining a control strategy which is not used by calling different interfaces, and realizing the sliding control on the sliding mechanism provided with the light supplement lamp, so that the control strategy is more targeted and meets the user requirements under the corresponding scene.

Description

Control method and device of sliding mechanism and electronic equipment
Technical Field
The invention relates to the technical field of mobile terminals, in particular to a control method and device of a sliding mechanism and electronic equipment.
Background
In order to improve user experience, devices such as open holes or exposed cameras arranged on the surface of the mobile terminal are less and less, and even a full-screen design has been proposed.
In the prior art, in order to reduce the aesthetic property that the appearance of the mobile terminal is affected by the exposure of devices, devices such as light supplement lamps arranged on some mobile terminals are arranged on a sliding mechanism, so that the devices can slide out of or be accommodated in a mobile terminal body. Thus, under different use scenarios, how to use and control these devices becomes an urgent problem to be solved.
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, the invention provides a control method of a sliding mechanism, which monitors the calling of a target interface for controlling a light supplement lamp, adopts different control strategies aiming at different called interfaces, and performs sliding control on the sliding mechanism provided with the light supplement lamp, so that the control strategies under different application scenes are more targeted, and the requirements of users under the scenes are better met.
The invention provides a control device of a sliding mechanism.
The invention provides an electronic device.
The invention provides a computer readable storage medium.
An embodiment of an aspect of the present invention provides a control method for a sliding mechanism, where the control method is applied to an electronic device, the electronic device includes a body and the sliding mechanism, the sliding mechanism is provided with a light supplement lamp, the sliding mechanism can move relative to the body to protrude from the body or be accommodated in the body, and the method includes:
monitoring the calling of the target interface; the target interface is used for controlling the light supplement lamp;
determining a corresponding control strategy according to the called target interface;
and adopting the control strategy to perform sliding control on the sliding mechanism provided with the light supplement lamp.
In another aspect, an embodiment of the present invention provides a control device for a sliding mechanism, which is applied to an electronic device, where the electronic device includes a body and the sliding mechanism, the sliding mechanism is provided with a light supplement lamp, and the sliding mechanism is movable relative to the body to protrude from the body or be accommodated in the body, and the device includes:
the calling module is used for monitoring calling of the target interface; the target interface is used for controlling the light supplement lamp;
the determining module is used for determining a corresponding control strategy according to the called target interface;
and the control module is used for adopting the control strategy to carry out sliding control on the sliding mechanism provided with the light supplement lamp.
In another aspect, an embodiment of the present invention provides an electronic device, where the electronic device includes a body and the sliding mechanism, the sliding mechanism is provided with a light supplement lamp, and the sliding mechanism can move relative to the body to protrude from the body or be accommodated in the body;
the electronic device further includes: a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the sliding mechanism control method according to the aforementioned aspect when executing the program.
Yet another embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor, implements the sliding mechanism control method according to the foregoing aspect.
The technical scheme provided by the invention can have the following beneficial effects:
monitoring the calling of each target interface used for controlling the light supplement lamp, determining a corresponding control strategy according to the called target interface, performing sliding control on the sliding mechanism provided with the light supplement lamp by adopting the control strategy, determining a control strategy which is not used by calling different interfaces, and realizing the sliding control on the sliding mechanism provided with the light supplement lamp, so that the control strategy is more targeted and meets the user requirements under the corresponding scene.
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 method for controlling a sliding mechanism according to an embodiment of the present invention;
fig. 2 is a schematic flow chart illustrating another control method for a sliding mechanism according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of a method for controlling a sliding mechanism according to another embodiment of the present invention;
fig. 4 is a schematic structural diagram of a control device of a sliding mechanism according to an embodiment of the present invention; and
fig. 5 is a schematic structural diagram of an electronic device according to an 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 drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention.
A control method, apparatus, and electronic device of a sliding mechanism according to an embodiment of the present invention are described below with reference to the drawings.
Fig. 1 is a schematic flow chart of a control method of a sliding mechanism according to an embodiment of the present invention.
The method provided by the embodiment of the invention is applied to the electronic equipment, the electronic equipment comprises a body and a sliding mechanism, the sliding mechanism is provided with the light supplementing lamp, and the sliding mechanism can move relative to the body so as to protrude out of the body or be accommodated in the body. The electronic equipment can be a mobile terminal, and the mobile terminal comprises a mobile phone, an ipad, a palm computer, a notebook computer and the like.
As shown in fig. 1, the method comprises the steps of:
step 101, calling of a target interface is monitored, and the target interface is used for controlling a light supplement lamp.
The supplementary lighting lamp is used for supplementary lighting in different application scenes of the electronic device, for example, as a flashlight to provide lighting supplementary lighting, as a flash lamp to provide supplementary lighting during photographing, or as an emergency call lamp to provide flashing and the like.
Specifically, the calling of a target interface for controlling the light supplement lamp in the electronic device is monitored, and the called specific target interface is monitored.
And 102, determining a corresponding control strategy according to the called target interface.
The purpose of the control strategy is to perform sliding control on a sliding mechanism provided with the light supplement lamp.
Specifically, the number of target interfaces is at least two, and if the called target interfaces are different, the corresponding control strategies are different, in the embodiment of the present invention, 2 target interfaces are taken as an example and are respectively a system control interface for singly controlling the fill light and a camera service interface for controlling the camera and the fill light, and when 2 different interfaces are called, the corresponding control strategies are not described in detail.
And 103, performing sliding control on the sliding mechanism provided with the light supplement lamp by adopting a control strategy.
As a possible implementation manner, if the target interface is a system control interface for controlling the light supplement lamp singly, a control strategy is adopted to perform sliding control on the sliding mechanism provided with the light supplement lamp, specifically, a calling parameter adopted by calling the system control interface is determined, the calling parameter is used for indicating the on-off state of the light supplement lamp, a state flag bit of the light supplement lamp is set according to the on-off state indicated by the calling parameter, and when the state flag bit indicates that the light supplement lamp is in the on state, if an instruction for controlling the sliding mechanism to be accommodated in the body is obtained, the instruction is prohibited from being executed. And controlling the sliding mechanism to move to protrude out of the body or be accommodated in the body according to the switch state indicated by the calling parameter. For clarity, in a case that the target interface is a system control interface for controlling a light supplement lamp, the control strategy adopted will be described in detail in the embodiment corresponding to fig. 2, and will not be described herein again.
As another possible implementation manner, the sliding mechanism is further provided with a camera, and the target interface includes a camera service interface for controlling the camera and the light supplement lamp. Under the condition of calling a camera service interface, the adopted control strategy is specifically that the sliding mechanism is controlled to move to protrude out of the body, the adopted calling parameter for indicating the on-off state of the light supplement lamp is determined according to the control function of the light supplement lamp in the camera service interface, the state flag bit of the light supplement lamp is set according to the on-off state indicated by the calling parameter, and when the state flag bit indicates that the light supplement lamp is in the on state, if the instruction for controlling the sliding mechanism to be accommodated in the body is obtained, the instruction is forbidden to be executed; if the parameter is called to indicate that the light supplement lamp is in the off state, the sliding mechanism is controlled to move so as to be contained in the body. For clarity, the control strategy adopted in the case that the target interface is the camera service interface will be described in detail in the embodiment corresponding to fig. 3, and will not be described herein again.
According to the control method of the sliding mechanism, calling of the target interface is monitored, the target interface is used for controlling the light supplement lamp, the corresponding control strategy is determined according to the called target interface, the control strategy is adopted to perform sliding control on the sliding mechanism with the light supplement lamp, different control strategies are determined by calling different interfaces, sliding control on the sliding mechanism with the light supplement lamp is achieved, the control strategy is more targeted, and user requirements under corresponding scenes are met.
To clearly illustrate the previous embodiment, this embodiment provides a possible implementation manner of another control method for a sliding mechanism, and fig. 2 is a schematic flow chart of the control method for another sliding mechanism provided in the embodiment of the present invention, and further clearly illustrates that when a called interface is a system control interface, different control strategies are correspondingly adopted in different application scene types to realize sliding control over the sliding mechanism provided with a fill light, so that the control strategies are more targeted, and the sliding mechanism can be controlled to slide out or reset in time according to a calling parameter when the called interface is the system control interface.
As shown in fig. 2, the method provided by the present embodiment, executed by a control program of the sliding mechanism, may include the following steps:
step 201, it is monitored that the called target application program interface is a system control interface for singly controlling the fill light.
Specifically, according to different application programs, at least two interface calling modes can be provided to realize the flashlight function, and one mode is to call a system control interface for singly controlling the light supplement lamp, which is generally a google native interface; the other is through a camera service interface for controlling the camera and the fill light.
In this embodiment, how to control the sliding out and resetting of the sliding mechanism under the condition that the flashlight function is achieved by controlling the on and off of the light supplement lamp through the system control interface by the application program will be described in detail, and how to control the sliding mechanism under the condition that the light supplement lamp is controlled by calling the camera service interface by the application program in the subsequent embodiments.
Step 202, determining a calling parameter used for calling the system control interface.
And calling parameters for indicating the on-off state of the light supplement lamp.
Step 203, determining whether the switch state indicated by the calling parameter is an on state, if so, executing step 204, and if not, executing step 207.
Specifically, a status flag bit of the light supplement lamp is set according to the on-off status indicated by the calling parameter, if the on-off status indicated by the calling parameter is an on status, the status flag bit of the light supplement lamp in the on status is set, and if the on-off status indicated by the calling parameter is an off status, the status flag bit of the light supplement lamp in the off status is set. The status flag bit is used for controlling the program to judge whether the sliding mechanism can be reset to be accommodated in the body, so that the situation that the sliding mechanism is mistakenly moved to be accommodated in the body when the light supplement lamp is in an on state, namely the application program still uses the light supplement lamp, is avoided.
And step 204, setting a status flag bit of the light supplement lamp in an on state.
For example, the fill light is turned on, and the status flag is set to "1".
Step 205, controlling the sliding structure to move to protrude from the body.
Specifically, after the light supplement lamp is turned on, the sliding mechanism is controlled to move to protrude out of the body.
In step 206, if the command for controlling the sliding mechanism to be accommodated in the body is obtained, the command is prohibited from being executed.
Specifically, when the light supplement lamp is in an on state, if an instruction for controlling the sliding mechanism to be accommodated in the body by other application programs is acquired, the instruction is prohibited from being executed, because the sliding mechanism provided with the flash lamp cannot be slidably accommodated in the body in any scene when the light supplement lamp is in the on state, so that the normal use of the light supplement lamp is not affected.
And step 207, setting a status flag bit of the light supplement lamp in a closed state.
For example, the fill-in light is turned off, and the status flag is set to "0"
And 208, if the calling parameter for indicating the opening state is not acquired within the preset delay time, controlling the sliding mechanism to move to be contained in the body.
If the system control interface is called, and an SOS (Save ourer Souls) mode is adopted, when the SOS mode is adopted, the light supplement lamp can be frequently switched between the on state and the off state, the flash of the light supplement lamp is realized, and the SOS reminding function is played. When the light filling lamp twinkles, the status flag bit of the light filling lamp also can be correspondingly set back and forth between the indication opening state and the closing state, the sliding mechanism can be correspondingly frequently lifted and lowered, and the user experience is poor.
In order to solve the problem, in a scene, when the state flag bit of the light supplement lamp indicates an off state, when the sliding mechanism needs to be controlled to move to be accommodated in the body, whether the light supplement lamp is currently in the SOS mode needs to be determined, a delay time length can be preset, if a calling parameter for indicating an on state is not obtained within the preset delay time length, it indicates that the light supplement lamp is not currently in the SOS mode, after the preset time length is finished, the sliding mechanism is controlled to move to be accommodated in the body, and meanwhile, the state flag bit is set to be in the off state.
In another scenario, if a calling parameter for indicating an on state is acquired within a preset delay time, it is indicated that the light supplement lamp is currently in an SOS mode, and the frequent movement of the sliding mechanism protrudes from and is moved to be accommodated in the body due to the SOS mode, so that the user experience is poor, a delay message needs to be sent to enable the sliding mechanism to be accommodated in the body in a delayed manner, so that only the light supplement lamp flickers, the off state is indicated at a state flag bit of the light supplement lamp, and when it is monitored that the calling parameter for indicating the on state is not acquired within the preset delay time, the SOS mode of the light supplement lamp is considered to be ended, after the preset time is ended, the sliding mechanism is controlled to be moved to be accommodated in the body, and meanwhile, the state flag bit is set to be.
In the control method of the sliding mechanism, when a called target application program interface is a system control interface for singly controlling the light supplement lamp, calling parameters adopted by the calling system control interface are determined, a state flag bit of the light supplement lamp is set according to the calling parameters, when the light supplement lamp is in an on state, the sliding mechanism is controlled to move to protrude out of the body, the sliding mechanism is timely moved to protrude out of the body after the light supplement lamp is turned on, and in the on state of the light supplement lamp, the obtained instruction for controlling the sliding mechanism to be accommodated in the body is forbidden to be executed to prevent other application processes from being executed, so that the sliding mechanism slides back to the body when the light supplement lamp is turned on, and the normal use of the light supplement lamp is influenced; when the light supplement lamp is in the closed state, the preset time is set, and if the calling parameter for indicating the open state is not obtained in the preset time, the sliding mechanism is controlled to move to be contained in the body, so that the frequent descending and lifting of the sliding mechanism under the scene where the light supplement lamp is required to flicker are avoided, and the light supplement lamp is more suitable for the requirements of various scenes.
In the above embodiment, when a system interface for performing single control on the light supplement lamp is called, a control method for the sliding mechanism in different scenes is described, and in practical application, a camera may be further disposed in the sliding mechanism of the electronic device, and a target interface may be a camera service interface for controlling the camera and the light supplement lamp, so that this embodiment provides yet another possible implementation manner for the control method for the sliding mechanism, fig. 3 is a flowchart of the control method for the sliding mechanism provided in the embodiment of the present invention, which further clearly illustrates that when the called interface is the camera service interface, in different application scene types, different control strategies are correspondingly employed to realize sliding control on the sliding mechanism provided with the light supplement lamp, so that the control strategies are more targeted.
As shown in fig. 3, the method comprises the following steps:
step 301, it is monitored that the called target application program interface is a camera service interface.
The camera service interface writes calling parameters in a light supplement lamp interface in the camera service interface to control the sliding mechanism to move to protrude out of the body and turn on the light supplement lamp or move to be contained in the body and turn off the light supplement lamp.
Step 302, controlling the sliding mechanism to move to protrude from the body.
Specifically, when the called target interface is the camera service interface, the sliding mechanism is directly controlled to move to protrude out of the body, and therefore the sliding mechanism can be quickly moved to protrude out of the body when the camera service interface is called.
And step 303, if a calling parameter indicating the on state is monitored, setting a state flag bit of the light supplement lamp to be in the on state.
And calling parameters for indicating the on-off state of the light supplement lamp.
In an application scene, an application program only has a flashlight function, the flashlight function can be triggered by a separately arranged light supplement lamp switch touch key, a camera service interface is not called immediately after the light supplement lamp application program is started, but the camera service interface is called in response to the operation of a user on the switch touch key, a calling parameter for indicating the turn-on of a light supplement lamp is written in a control function of the light supplement lamp in the camera service interface, when the calling parameter for indicating the turn-on of the light supplement lamp is monitored, a state flag bit of the light supplement lamp is set to be in an on state, that is, in the application scene, the calling parameter for indicating the turn-on or turn-off of the light supplement lamp is written in the control function of the light supplement lamp in the camera service interface according to the operation of the user on the switch touch key, and the light supplement lamp is correspondingly turned on or turned off according to.
In another application scenario, the application program only has a flashlight function, but after the application program is started, the application program executes an interface for calling the camera service, writes a calling parameter for indicating the turn-on of the fill-in light into a control function of the fill-in light in the camera service interface so as to turn on the fill-in light; when the application program exits or the application program is switched to the background operation, the control on the camera service interface is released, and in the application scene, the control function of the light supplement lamp is not called by using a call parameter for controlling the closing, but the call on the camera service interface is directly released, and the status flag bit of the light supplement lamp cannot be set to be in the closed state, so that when the control on the camera service interface is needed to be released, whether the status flag bit of the light supplement lamp is in the closed state is monitored, namely, the sliding mechanism is logically controlled corresponding to the judgment and control method in the step 304 and the step 306, so that the control strategy is more in line with the requirement of the application scene.
In another application scenario, the fill-in light application program has a flashlight function and a camera function, and after the application program is started, the camera service interface is called to hold the camera and control the sliding mechanism to move so as to protrude out of the body. Generally, the application programs are provided with a switch touch key of the light supplement lamp, and corresponding calling parameters are adopted to call the flashlight interface nodes, namely control functions of the light supplement lamp, in response to user operation so as to turn on or turn off the light supplement lamp. When the calling parameter indicating the turn-off of the light supplement lamp is monitored, the sliding mechanism is controlled to move to be contained in the body, when the calling parameter which is turned on is monitored, the sliding mechanism is controlled to move to protrude out of the body, and before the application program exits, the camera service interface is released.
Furthermore, when the light supplement lamp is in the on state, if an instruction for controlling the sliding mechanism to be accommodated in the body by other application programs is acquired, the instruction is forbidden to be executed, because the sliding mechanism provided with the flash lamp cannot be slidingly accommodated in the body in any scene when the light supplement lamp is in the on state, so that the normal use of the light supplement lamp is not influenced.
Step 304, determining whether a call parameter indicating a closed state is monitored, if so, executing step 307, and if not, executing step 305.
It should be noted that, in the application scenarios listed in the above steps, some irregular application programs do not call the control function of the fill-in light by using a call parameter for controlling closing after the camera service interface is released, that is, the status flag of the fill-in light is not set to be in the closed state, and the sliding mechanism is controlled to move to be accommodated in the body, so that after the call of the camera service interface is released by monitoring the call parameter for indicating the closed state, if the call parameter for indicating that the status flag of the fill-in light is in the closed state is not monitored, the control method in step 305 and step 306 is executed, so that logic control over the sliding mechanism can be implemented under various application programs, and the control strategy better meets the requirements of the application scenarios.
Step 305, when the operating state of the electronic device meets the preset condition, the calling of the camera service interface is released, and the status flag bit of the light supplement lamp is set to indicate that the light supplement lamp is in the off state.
And step 306, controlling the sliding mechanism to move so as to be accommodated in the body.
Wherein the preset conditions include: the electronic equipment is switched to a screen-off state; calling an application program of the camera service interface, and removing the calling of the camera service interface; and calling the application program of the camera service interface to switch to a background running state.
Specifically, when the electronic device monitors that the operation state meets any one of the preset conditions, the calling of the camera service interface is released, the light supplement lamp is turned off, the state flag bit of the light supplement lamp is set to indicate that the light supplement lamp is in the off state, and the sliding mechanism is controlled to move to be contained in the body, so that after the light supplement lamp is turned off, the sliding mechanism is controlled to move to be contained in the body, and after the calling of the camera service interface is released, the light supplement lamp is turned off, and the sliding mechanism is controlled to move to be contained in the body, so that the requirements of an application scene are met.
And 307, setting a status flag bit of the light supplement lamp in an off state.
Specifically, if the on-off state indicated by the calling parameter is the off state, the light supplement lamp is turned off, and the state flag bit of the light supplement lamp in the off state is set, for example, the light supplement lamp is turned off, and the state flag bit is set to "0".
And step 308, determining that the calling parameter for indicating the opening state is not acquired within the preset delay time.
Step 309, controlling the sliding mechanism to move to be accommodated in the body.
Specifically, when the status flag of the fill-in light is in an off state, the sliding mechanism needs to be controlled to move to be accommodated in the body, and in practical applications, in some scenarios, it needs to be determined by a delay time, and whether the sliding mechanism can be controlled to move to be accommodated in the body when the status flag of the fill-in light is in the off state or not.
The utility model provides an application scene, when the light filling lamp frequently flickers, in the light filling lamp application, generally be provided with light filling lamp scintillation function, a scintillation warning function for emergency's warning or user-defined, under this mode, the light filling lamp can frequently switch between two kinds of states of bright and going out, the state flag bit of light filling lamp also can correspond and make a round trip to switch between instructing the state of opening and closing, and the sliding mechanism can correspond frequently rise and fall, user experience is relatively poor. Therefore, when the status flag bit of the light supplement lamp indicates an off status, when the sliding mechanism needs to be controlled to move to be accommodated in the body, whether the light supplement lamp is currently in the SOS mode needs to be determined, a delay time can be preset, if a calling parameter for indicating an on status is not obtained within the preset delay time, it indicates that the light supplement lamp is not currently in the frequent flashing mode of the light supplement lamp, and after the preset time is over, the sliding mechanism is controlled to move to be accommodated in the body, and meanwhile, the status flag bit is set to be in the off status.
If a calling parameter for indicating an on state is acquired within a preset delay time, it is indicated that the light supplement lamp is currently in a frequent flashing mode, and due to the frequent flashing mode, frequent movement of the sliding mechanism protrudes out of the body and moves to be accommodated in the body, so that user experience is poor, a delay message needs to be sent, so that the sliding mechanism is delayed to move to be accommodated in the body, only the light supplement lamp flashes, the off state is indicated at a state flag bit of the light supplement lamp, and when the calling parameter for indicating the on state is not acquired within the preset delay time, the frequent flashing mode of the light supplement lamp is considered to be ended, after the preset delay time is monitored, the sliding mechanism is controlled to move to be accommodated in the body, and meanwhile, the state flag bit is set to be in the off state.
Another application scenario is that when the light of the current camera shooting environment is insufficient, the light supplement lamp is turned on to supplement light for shooting, and when the user switches between the front camera and the rear camera, after the corresponding light supplement lamp is turned off, it needs to be determined whether the sliding mechanism needs to be immediately controlled to move to be accommodated in the body by a set delay time length, for example, when the current camera shooting mode is the front camera shooting mode and the user needs to switch to the rear camera for shooting when the front camera shooting mode is finished, when the user switches the camera shooting mode, the front light supplement lamp corresponding to the front camera shooting mode is turned off, the rear camera is turned on, and the rear light supplement lamp is turned on, a certain time is spent in the switching process, at this time, the determination needs to be performed by the preset delay time length, so as to ensure that the sliding structure does not immediately move to be accommodated in the body due to the turning off of the light in the switching process of the front camera and the rear camera, the control strategy under the application scene meets the actual requirements of the scene, and the user satisfaction is high.
According to the control method of the sliding mechanism, when the called target application program interface is the camera service interface, the sliding mechanism is controlled to move to protrude out of the body, when the camera service interface is called, the sliding mechanism is controlled to move fast to protrude out of the body, fast response is achieved, the state flag bit of the light supplement lamp is set according to the calling function adopted in the camera service interface, meanwhile, the sliding mechanism is controlled to move to protrude out of the body or be contained in the body, different control under different application scenes is achieved, and the control strategy is enabled to better meet the requirements of the scenes. Meanwhile, according to the comparison between the running state of the electronic equipment and the preset condition, when the preset condition is met, the calling of the camera service interface is closed, the light supplementing lamp is closed, the flag bit is set to be in the closed state, the sliding mechanism is controlled to be contained in the body, and after the camera service interface is removed, the sliding mechanism is controlled to move rapidly to be contained in the body.
In order to implement the above embodiments, the present invention further provides a control device for a sliding mechanism, where the control device is applied to an electronic device, the electronic device includes a body and the sliding mechanism, the sliding mechanism is provided with a light supplement lamp, and the sliding mechanism can move relative to the body to protrude from the body or be accommodated in the body.
Fig. 4 is a schematic structural diagram of a control device of a sliding mechanism according to an embodiment of the present invention.
As shown in fig. 4, the apparatus includes: a calling module 41, a determining module 42 and a control module 43.
And the calling module 41 is configured to monitor calling of a target interface, where the target interface is used to control the light supplement lamp.
And the determining module 42 is configured to determine a corresponding control policy according to the called target interface.
And the control module 43 is configured to perform sliding control on the sliding mechanism provided with the light supplement lamp by using a control strategy.
Further, in a possible implementation manner of the embodiment of the present invention, the target interface includes a system control interface for singly controlling the fill light.
The control module 43 includes: a determination unit and a control unit.
The determining unit is used for determining a calling parameter adopted by calling the system control interface if the called target interface is the system control interface; calling parameters to indicate the on-off state of the light supplement lamp;
and the control unit is used for controlling the sliding mechanism to move to protrude out of the body or be accommodated in the body according to the switch state indicated by the calling parameter.
As a possible implementation manner, the control module may further include: a setting unit and a prohibiting unit.
And the setting unit is used for setting the status flag bit of the light supplement lamp according to the on-off state indicated by the calling parameter.
And the forbidding unit is used for forbidding to execute the command if the command for controlling the sliding mechanism to be accommodated in the body is obtained when the status flag bit indicates that the light supplement lamp is in the on state.
As a possible implementation manner, the control unit is specifically configured to:
if the calling parameter indicates the opening state, the sliding mechanism is controlled to move to protrude out of the body;
and if the calling parameter indicates the closing state and the calling parameter for indicating the opening state is determined not to be acquired within the preset delay time, controlling the sliding mechanism to move to be contained in the body.
Further, as a possible implementation manner, the sliding mechanism is further provided with a camera, and the target interface includes a camera service interface for controlling the camera and the light supplement lamp.
In the control module 43 described above:
and the control unit is also used for controlling the sliding mechanism to move to protrude out of the body if the called target interface is the camera service interface.
And the determining unit is also used for determining the adopted calling parameter for the control function of the light supplement lamp in the camera service interface, and the calling parameter is used for indicating the on-off state of the light supplement lamp.
And the setting unit is also used for setting the status flag bit of the light supplement lamp according to the on-off state indicated by the calling parameter.
And the prohibiting unit is also used for prohibiting the execution of the instruction if the instruction for controlling the sliding mechanism to be accommodated in the body is obtained when the status flag bit indicates that the light supplement lamp is in the on state.
As a possible implementation manner, the control unit may be further configured to control the sliding mechanism to move to be accommodated in the body if the parameter is called to indicate the closed state.
As a possible implementation manner, the control module 43 may be further configured to:
and determining that the calling parameter for indicating the opening state is not acquired within the preset delay time.
As a possible implementation manner, the control module 43 may be further configured to:
when the running state of the electronic equipment meets any preset condition, releasing the call of the camera service interface;
setting the status flag bit of the light supplement lamp to indicate that the light supplement lamp is in a closed state;
controlling the sliding mechanism to move so as to be accommodated in the body;
wherein the preset conditions include:
the electronic equipment is switched to a screen-off state;
calling an application program of the camera service interface, and removing the calling of the camera service interface;
and calling the application program of the camera service interface to switch to a background running state.
As a possible implementation manner, the control module 43 may be further configured to:
the sliding-out interface of the sliding mechanism is adopted to control the sliding mechanism to move to protrude out of the body;
the reset interface of the sliding mechanism is adopted to control the sliding mechanism to move so as to be contained in the body.
It should be noted that the foregoing explanation of the method embodiment is also applicable to the apparatus of this embodiment, and is not repeated herein.
The above-mentioned division of the modules of the control device of the sliding mechanism is only used for illustration, and in other embodiments, the control device of the sliding mechanism may be divided into other modules to implement all or part of the functions of the control device of the sliding mechanism.
In the control device of the sliding mechanism, the calling of the target interface is monitored, the target interface is used for controlling the light supplement lamp, the corresponding control strategy is determined according to the called target interface, the control strategy is adopted to perform sliding control on the sliding mechanism with the light supplement lamp, different control strategies are determined by calling different interfaces, and the sliding control on the sliding mechanism with the light supplement lamp is realized, so that the control strategy is more targeted and meets the user requirements in the corresponding scene.
Based on the foregoing embodiments, the embodiments of the present invention further provide a possible implementation manner of an electronic device, and fig. 5 is a schematic structural diagram of the electronic device provided in the embodiments of the present invention, and as shown in fig. 5, the electronic device includes: the device comprises a body 10, a sliding mechanism 20, a supplementary lighting lamp 21, a memory 31 and a processor 32.
The electronic device 100 includes: the light supplement lamp comprises a body 10 and a sliding mechanism 20, wherein the sliding mechanism 20 is provided with a light supplement lamp 21, and the sliding mechanism 20 can move relative to the body 10 to protrude out of the side wall of the body 10 or be accommodated in the body 10.
The sliding mechanism 20 is electrically connected to the processor 32, and the memory 31 stores a computer program that can be run on the processor 32, and when the processor 32 executes the computer program, the method for controlling the sliding mechanism according to the foregoing method embodiment is implemented.
In order to implement the above embodiments, the present invention also proposes a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the control method of the sliding mechanism described in the foregoing method embodiments.
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 are not necessarily intended to 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. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "a plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
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 steps of a custom logic function or 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.
The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
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. 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. 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 control method of a sliding mechanism is applied to electronic equipment, the electronic equipment comprises a body and the sliding mechanism, the sliding mechanism is provided with a light supplement lamp, the sliding mechanism can move relative to the body to protrude out of the body or be accommodated in the body, and the method comprises the following steps:
monitoring the calling of the target interface; the target interface is used for controlling the light supplement lamp;
determining a corresponding control strategy according to the called target interface; the number of the target interfaces is at least two, and if the called target interfaces are different, the corresponding control strategies are different;
adopting different control strategies to perform sliding control on the sliding mechanism provided with the light supplement lamp;
when the light supplement lamp is in an on state, if an instruction for controlling the sliding mechanism to be accommodated in the body is obtained, the instruction is forbidden to be executed;
when the status flag bit of the light supplement lamp is in an off state, if a calling parameter for indicating an on state is not obtained within a preset delay time, after the preset delay time is over, the sliding mechanism is controlled to move to be contained in the body.
2. The control method according to claim 1, wherein the target interface comprises a system control interface for individually controlling the fill light;
adopt different the control strategy is to being provided with slide control is carried out to the slide mechanism of light filling lamp, include:
if the called target interface is the system control interface, determining a calling parameter adopted for calling the system control interface; the calling parameter is used for indicating the on-off state of the light supplementing lamp;
and controlling the sliding mechanism to move to protrude out of the body or be accommodated in the body according to the switch state indicated by the calling parameter.
3. The control method according to claim 2, wherein after determining the call parameter used for calling the system control interface, the method further comprises:
setting a status flag bit of the light supplement lamp according to the on-off status indicated by the calling parameter;
and when the state flag bit indicates that the light supplement lamp is in an on state, if an instruction for controlling the sliding mechanism to be accommodated in the body is obtained, the instruction is forbidden to be executed.
4. The control method according to claim 2, wherein the controlling the sliding mechanism to move to protrude from the body or to be accommodated in the body according to the switch state indicated by the calling parameter comprises:
if the calling parameter indicates an opening state, controlling the sliding mechanism to move to protrude out of the body;
and if the calling parameter indicates a closing state and the calling parameter for indicating an opening state is determined not to be acquired within a preset delay time, controlling the sliding mechanism to move to be contained in the body.
5. The control method according to claim 1, wherein the sliding mechanism is further provided with a camera, and the target interface comprises a camera service interface for controlling the camera and a fill light;
adopt different the control strategy is to being provided with slide control is carried out to the slide mechanism of light filling lamp, include:
and if the called target interface is the camera service interface, controlling the sliding mechanism to move to protrude out of the body.
6. The control method according to claim 5, wherein the controlling the sliding mechanism to move to protrude from the body further comprises:
determining adopted calling parameters for a control function of a fill light in the camera service interface; the calling parameter is used for indicating the on-off state of the light supplementing lamp;
setting a status flag bit of the light supplement lamp according to the on-off status indicated by the calling parameter;
and when the state flag bit indicates that the light supplement lamp is in an on state, if an instruction for controlling the sliding mechanism to be accommodated in the body is obtained, the instruction is forbidden to be executed.
7. The control method according to claim 6, wherein after determining the call parameter used for calling the control function, the method further comprises:
and if the calling parameter indicates a closing state, controlling the sliding mechanism to move so as to be contained in the body.
8. The control method according to claim 7, wherein the controlling the sliding mechanism to move to be accommodated before the body further comprises:
and determining that the calling parameter for indicating the opening state is not acquired within the preset delay time.
9. The control method of claim 6, wherein if the called target interface is the camera service interface, controlling the sliding mechanism to move to protrude from the body further comprises:
when the running state of the electronic equipment meets any preset condition, releasing the call of the camera service interface;
setting the status flag bit of the light supplement lamp to indicate that the light supplement lamp is in a closed state;
controlling the sliding mechanism to move so as to be accommodated in the body;
wherein the preset conditions include:
the electronic equipment is switched to a screen-off state;
calling an application program of the camera service interface, and removing the calling of the camera service interface;
and calling the application program of the camera service interface to switch to a background running state.
10. The control method according to any one of claims 1 to 9, wherein the performing of the sliding control on the sliding mechanism provided with the fill light includes:
the sliding-out interface of the sliding mechanism is adopted to control the sliding mechanism to move to protrude out of the body;
and the reset interface of the sliding mechanism is adopted to control the sliding mechanism to move so as to be contained in the body.
11. The utility model provides a slide mechanism's controlling means, its characterized in that is applied to electronic equipment, electronic equipment include the body with slide mechanism, slide mechanism is provided with the light filling lamp, slide mechanism can be relative the body removes to protrusion in the body, perhaps, accept in the body, the device includes:
the calling module is used for monitoring calling of the target interface; the number of the target interfaces is at least two, and the target interfaces are used for controlling the light supplement lamp;
the determining module is used for determining corresponding control strategies according to the called target interfaces, wherein the number of the target interfaces is at least two, and if the called target interfaces are different, the corresponding control strategies are different;
and the control module is used for performing sliding control on a sliding mechanism provided with the light supplement lamp by adopting the different control strategies, forbidding execution of an instruction for controlling the sliding mechanism to be accommodated in the body if the instruction is acquired when the light supplement lamp is in an on state, and controlling the sliding mechanism to move to be accommodated in the body if a calling parameter for indicating the on state is not acquired within a preset delay time when a state flag bit of the light supplement lamp is in an off state after the preset time is over.
12. An electronic device is characterized by comprising a body and the sliding mechanism, wherein the sliding mechanism is provided with a light supplementing lamp and can move relative to the body so as to protrude out of the body or be accommodated in the body;
the electronic device further includes: memory, processor and computer program stored on the memory and executable on the processor, which when executing the program implements a control method according to any of claims 1 to 10.
13. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the control method according to any one of claims 1 to 10.
CN201810601782.2A 2018-06-12 2018-06-12 Control method and device of sliding mechanism and electronic equipment Active CN108810203B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810601782.2A CN108810203B (en) 2018-06-12 2018-06-12 Control method and device of sliding mechanism and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810601782.2A CN108810203B (en) 2018-06-12 2018-06-12 Control method and device of sliding mechanism and electronic equipment

Publications (2)

Publication Number Publication Date
CN108810203A CN108810203A (en) 2018-11-13
CN108810203B true CN108810203B (en) 2021-03-09

Family

ID=64085174

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810601782.2A Active CN108810203B (en) 2018-06-12 2018-06-12 Control method and device of sliding mechanism and electronic equipment

Country Status (1)

Country Link
CN (1) CN108810203B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109246361B (en) 2018-11-30 2020-05-12 Oppo广东移动通信有限公司 Camera module control method and device
CN109788184A (en) 2019-03-29 2019-05-21 维沃移动通信有限公司 A kind of camera module, mobile terminal and control method
CN112152723B (en) * 2019-06-28 2022-08-02 Oppo广东移动通信有限公司 Mobile terminal

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4190935B2 (en) * 2002-09-27 2008-12-03 富士フイルム株式会社 Mobile terminal device
CN2717138Y (en) * 2004-07-27 2005-08-10 上海迪比特实业有限公司 Pick-up head apparatus on mobile phone
CN105120135B (en) * 2015-08-25 2019-05-24 努比亚技术有限公司 A kind of binocular camera
CN106657456A (en) * 2016-10-24 2017-05-10 珠海格力电器股份有限公司 Mobile terminal

Also Published As

Publication number Publication date
CN108810203A (en) 2018-11-13

Similar Documents

Publication Publication Date Title
CN108810203B (en) Control method and device of sliding mechanism and electronic equipment
CN110351490B (en) Exposure method, exposure device and image pickup equipment
EP3825852B1 (en) Occupation control method and apparatus for camera application
CN103945201B (en) A kind of IR-Cut filter changing method, device and video camera
KR101735987B1 (en) Backlicht brightness control method and device
CN103428416A (en) Automatic terminal focusing mode switching method and terminal
CN107277872B (en) Network switching method, device, mobile terminal and computer readable storage medium
CN103685716A (en) Display mode switching method and electronic apparatus
CN105188189A (en) Gravity-sensor-based flash lamp illumination method and apparatus, and mobile terminal
CN105788536A (en) Backlight brightness adjusting method and device and terminal equipment
CN106155797B (en) Terminal equipment and switching method of performance modes thereof
JP7082876B2 (en) Convenient display brightness change
CN105788565B (en) A kind of brightness adjusting method and device
CN112654110B (en) Flicker control method and device of LED indicator lamp and terminal equipment
CN104243788A (en) Method and device obtaining target image, and terminal
WO2020232679A1 (en) Photographing control method and related device
CN107277386B (en) Method for reducing temperature rise, computer readable storage medium and mobile terminal
CN105991936B (en) Method for controlling automatic switching of infrared filter
CN108512261B (en) Battery charging method and device
JP2006238376A5 (en)
CN110493530B (en) Automatic exposure control method and device for monitoring camera
CN110488964B (en) Electronic equipment and adjusting method
CN107396017B (en) Intelligent terminal, video recording method thereof and device with storage function
CN110502301A (en) Switching method, device, terminal and the storage medium of Activity
CN112637417A (en) Infrared proximity sensor control method and device and mobile terminal

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