Focusing method and electronic equipment
By dynamically adjusting the movement trajectory of the focus motor, the relative position between the camera cover and the focus motor is balanced according to the moving position of the camera cover, the problems of slow focus speed and frequent collision in the prior art are solved, and the effects of fast focus and low collision are achieved.
Patent Information
- Application Number
- CN202311866430.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-29
- Publication Date
- 2025-07-01
AI Technical Summary
The focus speed of existing electronic devices is slow when turned on, and the focus motor and the camera cover are prone to collision, affecting the user experience.
By dynamically adjusting the movement trajectory of the focus motor, balance the relative position between the camera cover and the focus motor according to the moving position of the camera cover, achieving fast focus and reducing the risk of collision.
It improves the focus speed after the camera application is turned on, reduces the collision between the focus motor and the camera cover, and improves the user experience.
Smart Images

Figure CN120233608A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of terminals, and in particular, to a focusing method and an electronic device. Background Art
[0002] Nowadays, users have more and more usage requirements for camera applications in electronic devices such as mobile phones. For example, users hope that the camera application can focus quickly and accurately after being turned on. The camera module of an electronic device includes a lens and a focusing motor. The electronic device uses the focusing motor to drive the lens to achieve focusing. Since it takes a certain amount of time for the focusing motor to drive the lens to move to the target position, the focusing speed of the camera application is slow. Summary of the Invention
[0003] This application provides a focusing method and an electronic device. This method can move the focusing motor according to the movement of the camera cover, balance the relative positions between the camera cover and the focusing motor, achieve quick focusing after the camera application is turned on, and reduce the collision between the focusing motor and the camera cover.
[0004] In a first aspect, this application provides a focusing method. This method can be applied to an electronic device, which includes a camera module and a camera cover, and the camera module includes a focusing motor. Among them, the electronic device turns on the camera application and determines a first target position for the focusing motor to move; the electronic device moves the camera cover; when the camera cover moves to a first position, and the distance between the first position and the first target position is greater than or equal to a first distance, the electronic device moves the focusing motor to the first target position, where the first position is less than the target position of the camera cover.
[0005] The first target position for the focusing motor to move can refer to the target position X shown in this application Figure 5 or Figure 6 the target position X' shown.
[0006] The camera cover moves to the first position. The first position can refer to the position Y2 shown in this application Figure 5 or Figure 6 the position Y1 shown, or Figure 7 the position Y3' shown. The target position of the camera cover can refer to the target position Y shown in this application Figures 5 to 7 shown.
[0007] The first distance can ensure that there is no collision between the camera module and the camera cover.
[0008] The above-mentioned first position being less than the target position of the camera cover can mean that the first position is closer to the initial position of the camera cover than the target position of the camera cover. The initial position of the camera cover can be the position where the camera cover is located when the camera application is not turned on. The initial position of the camera cover can refer to the battery cover position shown in this application Figures 5 to 7 shown.
[0009] It can be seen that the electronic device can move the focusing motor according to the position where the camera cover moves. Before the camera cover moves to the target position of the camera cover, if the position where the camera cover moves enables the focusing motor to move to the first target position without collision between the camera module and the camera cover, the electronic device can quickly move the focusing motor to the first target position to achieve focusing. In this way, the electronic device does not need to wait until the camera cover moves to the target position of the camera cover before moving the focusing motor. The above method can not only achieve quick focusing after the application is started, but also reduce the collision between the camera module and the camera cover.
[0010] In combination with the first aspect, in some embodiments, before the camera cover moves to the first position, when the camera cover moves to the second position, and the distance between the second position and the first target position is less than the first distance, the electronic device moves the focusing motor to the third position, and the distance between the second position and the third position is greater than or equal to the first distance.
[0011] The second position can refer to the position Y1 shown in this application Figure 5 or Figure 7 the figure shown. The third position can refer to the position X1 shown in this application Figure 5 or Figure 7 shown.
[0012] It can be seen that during the process of the camera cover moving towards the target position of the camera cover, the electronic device can move the focusing motor multiple times according to the position where the camera cover moves at different moments. If the position where the camera cover moves causes the camera module to collide with the camera cover after the focusing motor moves to the first target position, the electronic device can first move the focusing motor to the safe position corresponding to the current position of the camera cover. This safe position can enable the camera module to not collide with the camera cover after the focusing motor moves to the first target position. The above embodiments can gradually move the focusing motor to the target position of the focusing motor while reducing the collision between the camera cover and the focusing motor. In this way, it can not only reduce the collision between the camera cover and the focusing motor, but also improve the focusing efficiency after the camera application is started.
[0013] In combination with the first aspect, in some embodiments, before the camera cover moves to the first position, during the process of the focusing motor moving to the third position, the electronic device continues to move the camera cover; when the camera cover moves to the fourth position, and the distance between the fourth position and the third position is less than the first distance, the electronic device moves the focusing motor to the fifth position, and the distance between the fourth position and the fifth position is greater than or equal to the first distance.
[0014] The fourth position can refer to the position Y2’ shown in this application Figure 7 shown. The fifth position can refer to the position X2 shown in this application Figure 7 shown.
[0015] As can be seen from the above embodiments, when the camera cover moves to the second position, the distance between the second position and the third position is greater than or equal to the first distance. And the distance between the fourth position and the third position is less than the first distance. Therefore, when the camera cover moves from the second position to the fourth position, it can indicate that the camera cover is retracting, that is, moving in the direction opposite to the target position of the camera cover. The direction opposite to the target position of the camera cover is the direction where the focusing motor is located.
[0016] It can be seen that during the movement of the camera cover, the electronic device can detect whether the camera cover moves in the direction where the focusing motor is located. When it is detected that the camera cover moves in the direction where the focusing motor is located, the electronic device can adjust the position of the focusing motor and move the focusing motor away from the camera cover to reduce the situation of collision between the focusing motor and the camera cover.
[0017] Combined with the first aspect, in some embodiments, after the camera cover moves to the fourth position, the electronic device displays a first prompt message, and the first prompt message is used to prompt the user that there is an abnormality in the movement of the camera cover.
[0018] The movement of the camera cover in the direction where the focusing motor is located may be caused by the user accidentally touching the camera cover. The above prompt message for prompting the user that there is an abnormality in the movement of the camera cover can reduce the situation of collision between the camera cover and the focusing motor caused by the user accidentally touching the camera cover.
[0019] Combined with the first aspect, in some embodiments, before the camera cover moves to the first position, during the process of the focusing motor moving to the third position, the electronic device continues to move the camera cover; when the camera cover moves to the sixth position, and the distance between the sixth position and the third position is greater than the distance between the second position and the third position, and the distance between the sixth position and the first target position is less than the first distance, the electronic device moves the focusing motor to the seventh position, and the distance between the sixth position and the seventh position is greater than or equal to the first distance.
[0020] Combined with the first aspect, in some embodiments, before the camera cover moves to the sixth position, when the focusing motor moves to the third position, the electronic device pauses moving the focusing motor.
[0021] It can be seen that before the focusing motor moves to the target position of the focusing motor, the electronic device can move the focusing motor to a position where the camera module will not collide with the camera cover multiple times according to the position of the camera cover movement. And after the focusing motor moves to a position where the camera module will not collide with the camera cover, it can pause moving and wait for the next detection of the position of the camera cover movement to determine how to move next. This can better avoid the collision between the camera module and the camera cover when the camera application is started for focusing.
[0022] In connection with the first aspect, in some embodiments, after the electronic device turns on the camera application, the electronic device starts moving the focus motor after a first time period of starting to move the camera cover, or starts moving the camera cover and the focus motor simultaneously.
[0023] In connection with the first aspect, in some embodiments, after the camera cover moves to a first position, the electronic device continues to move the camera cover until the camera cover is moved to the target position of the camera cover. It can be seen that the movement of the camera cover can be independent of the camera module. When the camera application is turned on, the camera cover can move to the target position of the camera cover at a preset speed and trajectory and stay at the target position of the camera cover before the camera application is turned off.
[0024] In connection with the first aspect, in some embodiments, after the camera cover is moved to the target position of the camera cover, the electronic device keeps the camera cover at the target position of the camera cover; when the target position of the focus motor changes from a first target position to a third target position, the electronic device moves the focus motor to the third target position.
[0025] It can be seen that the target position of the camera cover is the farthest position where the camera cover can move. When the camera cover is in the target position of the camera cover, it will not collide with the camera module. After the camera cover is moved to the target position of the camera cover, the electronic device can stop detecting the position of the camera cover and directly move the focus motor to the corresponding target position. The above embodiments can save the power consumption of the electronic device.
[0026] In connection with the first aspect, in some embodiments, the first distance is the safety distance between the focus motor and the camera cover. When the focus motor moves to the first distance, the camera module and the camera cover will not collide.
[0027] In a second aspect, the present application provides an electronic device, which may include a camera module, a camera cover, a memory, and a processor. Among them, the camera module can be used to capture images. The camera module may include lenses and a focus motor. The focus motor can be used to push the lenses to achieve focusing. The camera cover can be used to provide a space for the movement of the camera module and protect the internal structure of the electronic device. The memory can be used to store computer programs. The processor can be used to call the computer program so that the electronic device executes any possible implementation method in the first aspect.
[0028] In a third aspect, the present application provides a computer-readable storage medium, including instructions, which when running on an electronic device, cause the electronic device to execute any possible implementation method in the first aspect.
[0029] Fourthly, the present application provides a computer program product, which may include computer instructions. When the computer instructions run on an electronic device, the electronic device is caused to execute any possible implementation method in the first aspect.
[0030] Fifthly, the present application provides a chip, which is applied to an electronic device. The chip includes one or more processors, and the processors are used to call computer instructions to cause the electronic device to execute any possible implementation method in the first aspect.
[0031] It can be understood that the electronic device provided in the second aspect above, the computer-readable storage medium provided in the third aspect, the computer program product provided in the fourth aspect, and the chip provided in the fifth aspect are all used to execute the method provided in the embodiments of the present application. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method, and will not be elaborated here. Description of the Drawings
[0032] Figure 1 is a schematic diagram of lens imaging provided by an embodiment of the present application;
[0033] Figure 2A and Figure 2B is a schematic diagram of a camera module provided by an embodiment of the present application;
[0034] Figure 3 is a schematic structural diagram of an electronic device 100 provided by an embodiment of the present application;
[0035] Figure 4 is a software structure block diagram of an electronic device 100 provided by an embodiment of the present application;
[0036] Figures 5 to 7 are some schematic diagrams of focusing scenarios provided by an embodiment of the present application;
[0037] Figure 8 is a flowchart of a focusing method provided by an embodiment of the present application. Detailed Embodiments
[0038] The following describes the technical solutions in the embodiments of the present application in conjunction with the accompanying drawings in the embodiments of the present application. Among them, in the description of the embodiments of the present application, the terms used in the following embodiments are only for the purpose of describing specific embodiments, and are not intended to limit the present application. As used in the specification and appended claims of the present application, the singular forms "a", "the", "above-mentioned", "this" and "this one" are also intended to include expressions such as "one or more", unless there is a clear indication to the contrary in the context. It should also be understood that in the following embodiments of the present application, "at least one" and "one or more" mean one or more than two (including two). The term "and / or" is used to describe the association relationship of associated objects, indicating that three relationships can exist; for example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects before and after.
[0039] References to "one embodiment" or "some embodiments" or the like described in this specification mean that a particular feature, structure, or characteristic described in connection with that embodiment is included in one or more embodiments of the present application. Thus, the phrases "in one embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments", etc. that appear in different places in this specification do not necessarily all refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "comprising", "including", "having" and their variants all mean "including but not limited to", unless otherwise specifically emphasized in other ways. The term "connection" includes direct connection and indirect connection, unless otherwise stated. "First" and "second" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance or implicitly indicating the quantity of the indicated technical features.
[0040] In the embodiments of the present application, words such as "exemplarily" or "for example" are used to represent examples, illustrations, or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of the present application should not be construed as being more preferred or having more advantages than other embodiments or designs. Rather, the use of words such as "exemplarily" or "for example" is intended to present relevant concepts in a specific manner.
[0041] For the sake of easy understanding, some concepts of camera focusing are introduced here.
[0042] 1. Object distance
[0043] The object distance can represent the distance from the object to be photographed to the lens used for photographing.
[0044] 2. Image distance
[0045] The image distance can represent the distance from the imaging plane to the lens used for taking pictures. The imaging plane can be called by names such as the image plane.
[0046] 3. Focus
[0047] The focus can represent the convergence point on the optical axis of the light rays passing through the lens and parallel to the optical center axis. The optical center axis can also be called the principal optical axis.
[0048] 4. Focal length
[0049] The focal length can represent the distance between the center of the lens and the focus. The longer the focal length, the farther the object the camera can capture. In some embodiments, the focal length of the camera is adjustable. The electronic device can adjust the focal length of the camera by means such as physical zoom or digital zoom.
[0050] The relationship among the object distance, the image distance, and the focal length can be expressed by the Gaussian imaging formula:
[0051]
[0052] Among them, u represents the object distance. v represents the image distance. f represents the focal length. When the object distance, the image distance, and the focal length satisfy the above Gaussian imaging formula, the electronic device can focus on the object to be photographed at the position corresponding to the object distance, so that the object is clearly imaged on the imaging plane.
[0053] Figure 1 An exemplary schematic diagram of lens imaging is shown.
[0054] As Figure 1 shown, the lens can be used to receive optical signals and converge the optical signals on the photosensitive sensor. The photosensitive sensor can be used to convert the optical signals into electrical signals to realize imaging of the object to be photographed. For example, the photosensitive sensor can include a charge-coupled device (CCD). The plane where the photosensitive sensor is located can be called the image plane. Object A can be the object to be photographed. Object A can be imaged as object A' on the photosensitive sensor through the lens. The distance from object A to the lens is the object distance. When the object distance changes, in order to make object A clearly imaged on the photosensitive sensor, the electronic device needs to adjust the image distance and / or the focal length.
[0055] For example, when object A moves away from the lens, the object distance increases. With the focal length unchanged, the electronic device needs to move the lens to reduce the image distance in order to focus on object A. When object A moves closer to the lens, the object distance decreases. With the focal length unchanged, the electronic device needs to move the lens to increase the image distance in order to focus on object A.
[0056] Figure 2A and Figure 2BAn exemplary schematic diagram of a camera module is shown.
[0057] As Figure 2A shown, the camera module may include lenses, a focusing motor, and an image sensor. The lenses may be a lens group composed of multiple lenses. In some embodiments, the focal length of the lens group can be changed by adjusting the relative positional relationship between the multiple lenses. When the focal length is fixed, the focusing motor can push all the lenses in the camera module to move as a whole to adjust the image distance for focusing. The camera module can be built into an electronic device and is located between the battery cover and the main board of the electronic device. The camera module can be snapped onto the main board. The camera module can also be referred to as a camera module.
[0058] The battery cover of the electronic device can also be referred to as the rear case or the back cover and can be used to protect the internal structure of the electronic device.
[0059] The main board of the electronic device may include hardware modules such as a central processing unit (CPU) and an image signal processor (ISP). The main board can be used to provide power and computing resources to the components snapped onto the main board (such as cameras, camera covers, etc.) and control the behavior of the components.
[0060] In some embodiments, the focusing motor can push the lenses to move within the space between the battery cover and the main board. This can change the image distance and achieve focusing on objects at different distances. Among them, the maximum travel distance of the focusing motor is limited by the distance between the battery cover and the main board. When the electronic device is relatively thin, the distance between the battery cover and the main board is short, and the focusing motor cannot push the lenses to a position far from the image sensor. Therefore, the image distance of the camera module is relatively small. From the above Gaussian imaging formula, it can be seen that the camera module cannot focus on objects at a relatively close position. The focusing effect of the camera module is poor, affecting the user's shooting experience. If it is necessary to increase the travel distance of the focusing motor, the thickness of the electronic device needs to be increased. In this way, although the camera module can focus on objects at a closer distance, the electronic device is thicker and the camera module is very prominent.
[0061] As Figure 2BAs shown, the electronic device may further include a camera cover. The camera cover can be connected to the battery cover to protect the internal structure of the electronic device together. Among them, the camera cover can be a lifting device. The camera cover can be set at the position corresponding to the camera module. When the camera application is turned on, the electronic device can move the camera cover in the direction outside the battery cover, so as to provide more space for the camera module. In this way, the focusing motor can push the lens to move within the space between the camera cover and the main board. Since the camera cover can rise to a position outside the battery cover, the focusing motor can also push the lens to move outside the battery cover. And after the camera cover rises to a position outside the battery cover, it can protect the camera module in the working state. For example, the camera cover can protect the camera module and reduce the situation where the camera module is damaged by collision. Moreover, the camera cover can also be waterproof and dustproof. The optical signal can pass through the camera cover and be received by the lens, and then be converged by the lens to the photosensitive sensor.
[0062] When the camera application is turned off, the focusing motor can push the lens back to the initial position, and the camera cover also returns to the initial position. The initial position of the camera cover can be a position parallel to the battery cover or a position slightly higher than the battery cover. In this way, when the camera application is not needed, the electronic device can be in a state with a smaller thickness. The above-mentioned focusing motor and camera cover can move independently. The embodiments of the present application do not limit the initial position of the above-mentioned focusing motor and the initial position of the camera cover.
[0063] It can be seen that the above-mentioned camera cover can enable the focusing motor to push the lens to move to a farther position. The moving stroke of the focusing motor can be not limited by the thickness of the electronic device. This can increase the focusing range of the camera module. The camera module can not only focus on distant objects, but also focus on closer objects.
[0064] The above-mentioned camera cover can also be called by names such as a moving lens and a camera protection cover.
[0065] In some embodiments, the size of the photosensitive sensor in the camera module is relatively large. The larger the size of the photosensitive sensor, the larger the photosensitive area, the more light can be captured, and the richer the information of the recorded photo. A photosensitive sensor with a large size can bring better color accuracy, low-light performance, and noise control. A camera module with a large-size photosensitive sensor can be called a large-bottom camera module or a large-bottom module. Although the imaging quality of the large-bottom camera module is relatively high, the large-bottom camera module requires more space. In order to be able to make full use of the large-size sensor for imaging, the focusing motor also needs a longer moving stroke.
[0066] The above Figure 2B The electronic device with the camera cover shown above can meet the imaging requirements of the large-bottom camera module.
[0067] When the electronic device with a camera cover turns on the camera application, the electronic device needs to move both the camera cover and the focusing motor to their respective target positions. The target position for the camera cover to move to can be the farthest position where the camera cover can extend and retract. The target position of the focusing motor can be preset or determined based on the initial image captured by the camera module. The moving speed of the focusing motor is usually faster than that of the camera cover.
[0068] In some embodiments, in order to avoid the camera cover and the focusing motor making a sound collision during movement, the electronic device can first move the camera cover to the target position of the camera cover and then move the focusing motor to the target position of the focusing motor. However, moving both the camera cover and the focusing motor to their respective target positions takes a certain amount of time. This results in slow focusing of the camera module. The first few frames of images displayed after the electronic device turns on the camera application may be blurred due to the focusing motor not moving to the target position.
[0069] Alternatively, in order to improve the focusing speed, the electronic device starts moving the focusing motor before the camera cover has moved to the target position of the camera cover. Since the moving speed of the focusing motor is faster than that of the camera cover, the focusing motor may push the lens and the camera cover to make a sound collision, generating abnormal noise. This may damage the camera module and affect the user experience of using the camera application.
[0070] The embodiments of the present application provide a focusing method, which can dynamically adjust the moving trajectory of the focusing motor according to the movement of the camera cover, balance the relative positions between the camera cover and the focusing motor, achieve fast focusing after the camera application is turned on, and reduce the collision between the focusing motor and the camera cover. The collision between the focusing motor and the camera cover can refer to the focusing motor pushing the lens to collide with the camera cover, or it can refer to the camera module colliding with the camera cover.
[0071] When the camera application is launched, the electronic device can determine the target position of the focusing motor and start moving the camera cover in the direction where the target position of the camera cover is located. The electronic device can detect the position where the camera cover moves at regular intervals. There may be a distance, such as a first distance, between the focusing motor and the camera cover to prevent the camera module from colliding with the camera cover during the movement of the focusing motor. For example, when it is detected that the camera cover moves to position Y1, the electronic device can determine whether the distance between the target position of the focusing motor and position Y1 is less than the first distance. A distance greater than or equal to the above-mentioned first distance between the focusing motor and the camera cover can ensure that the focusing motor does not collide with the camera cover when pushing the lens. If the distance between the target position of the focusing motor and position Y1 is greater than or equal to the above-mentioned first distance, the electronic device can move the focusing motor to the target position of the focusing motor to complete the focusing. If the distance between the target position of the focusing motor and position Y1 is less than the above-mentioned first distance, the electronic device can move the focusing motor to the safe position corresponding to position Y1 and continue to move the camera cover. The distance between position Y1 and the safe position corresponding to position Y1 is greater than or equal to the above-mentioned first distance. After a period of time, the electronic device can detect the position where the camera cover moves again, and then move the focusing motor according to the relationship between the position of the camera cover and the target position of the focusing motor. Among them, the electronic device can detect the position of the camera cover multiple times to adjust the position of the focusing motor so that the focusing motor moves to the target position of the focusing motor.
[0072] The above-mentioned first distance can represent the safe distance between the focusing motor and the camera cover. When the focusing motor and the camera cover maintain this safe distance, it can prevent the focusing motor from colliding with the camera cover. The embodiments of the present application do not limit the value of the first distance.
[0073] It can be seen that the electronic device can move the focusing motor during the movement of the camera cover. The electronic device can detect the position of the camera cover multiple times, so as to move the focusing motor multiple times to prevent the focusing motor from colliding with the camera cover. Once it is detected that the safe position corresponding to the position of the camera cover exceeds the target position of the focusing motor, the electronic device can quickly move the focusing motor to the target position of the focusing motor to complete the focusing. That is to say, the electronic device does not need to wait for the camera cover to move to the target position of the camera cover before starting to move the focusing motor. This can not only improve the focusing speed after the electronic device launches the camera application, but also reduce the collision between the focusing motor and the camera cover during the focusing process.
[0074] Next, the structure of the electronic device 100 involved in the present application will be introduced.
[0075] Figure 3 The structural schematic diagram of the electronic device 100 provided by the present application is exemplarily shown.
[0076] As Figure 3As shown, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
[0077] It can be understood that the structure illustrated in the embodiments of this application does not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than those illustrated, or combine certain components, or split certain components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0078] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.
[0079] Among them, the controller may be the nerve center and command center of the electronic device 100. The controller may generate operation control signals according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.
[0080] A memory may also be provided in the processor 110 for storing instructions and data. In some examples, the memory in the processor 110 is a cache memory. This memory can hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can be directly retrieved from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0081] In this application, a computer program may be stored in the memory for enabling a controller or a processor to implement the focusing method of this application through an interface or a protocol. Exemplarily, the computer program stored in the memory can be used for: determining the target position of the focusing motor, controlling the movement of the camera cover and the focusing motor, real-time detecting the positions of the camera cover and the focusing motor during movement, judging the relationship between the target position of the focusing motor and the safe position corresponding to the position where the camera cover is located, processing captured images, and displaying, etc.
[0082] The USB interface 130 is an interface compliant with the USB standard specification. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used for data transmission between the electronic device 100 and peripheral devices. It can also be used to connect headphones to play audio through the headphones.
[0083] The charging management module 140 is used to receive a charging input from a charger. Herein, the charger can be a wireless charger or a wired charger. While charging the battery 142, the charging management module 140 can also supply power to the electronic device through the power management module 141.
[0084] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives inputs from the battery 142 and / or the charging management module 140 and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160, etc.
[0085] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, and the baseband processor, etc.
[0086] The antenna 1 and the antenna 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization rate of the antennas. For example: the antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0087] The mobile communication module 150 may provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., which are applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 may receive electromagnetic waves through the antenna 1, filter and amplify the received electromagnetic waves, and then transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 may also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves through the antenna 1 and radiate it out.
[0088] The wireless communication module 160 may provide solutions for wireless communications including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves through the antenna 2, performs frequency modulation and filtering processing on the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 may also receive the signals to be transmitted from the processor 110, perform frequency modulation and amplification on them, and convert them into electromagnetic waves through the antenna 2 and radiate them out.
[0089] The electronic device 100 realizes the display function through the GPU, the display screen 194, and the application processor, etc. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and is used for graphics rendering.
[0090] The display screen 194 is used to display images, videos, etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0091] The electronic device 100 may realize the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194, and the application processor, etc.
[0092] The ISP is used to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, and light passes through the lens and is transmitted to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye.
[0093] The camera 193 is used to capture still images or videos. An object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a CCD or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal and then transmits the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard format such as RGB or YUV. In some embodiments, the electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.
[0094] The camera 193 can be the camera module shown above Figure 2A and Figure 2B as shown.
[0095] In some embodiments, the electronic device 100 further includes the camera cover shown above Figure 2B as shown.
[0096] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transforms on the frequency point energy, etc.
[0097] The NPU is a neural-network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission pattern between human brain neurons, it can quickly process input information and can also continuously learn on its own. Through the NPU, applications such as intelligent cognition of the electronic device 100 can be realized, such as image recognition, face recognition, speech recognition, text understanding, etc.
[0098] The external memory interface 120 can be used to connect to an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to achieve the data storage function. For example, files such as music and videos are saved in the external memory card.
[0099] The internal memory 121 can be used to store computer-executable program code, and the executable program code includes instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 can include a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function (such as a sound playback function, an image playback function, etc.). The data storage area can store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.). In addition, the internal memory 121 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0100] The electronic device 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor, etc. For example, music playback, recording, etc.
[0101] The audio module 170 is used to convert digital audio information into an analog audio signal for output, and is also used to convert an analog audio input into a digital audio signal. The audio module 170 can also be used to encode and decode audio signals. In some examples, the audio module 170 can be disposed in the processor 110, or some functional modules of the audio module 170 can be disposed in the processor 110. The speaker 170A, also known as the "loudspeaker", is used to convert an audio electrical signal into a sound signal. The receiver 170B, also known as the "earpiece", is used to convert an audio electrical signal into a sound signal. The microphone 170C, also known as the "microphone", "transmitter", is used to convert a sound signal into an electrical signal. The headphone jack 170D is used to connect a wired headphone.
[0102] The sensor module 180 can include a pressure sensor, a gyroscope sensor, a barometric pressure sensor, a magnetic sensor, an acceleration sensor, a gravity sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.
[0103] The keys 190 include a power-on key, a volume key, etc. The motor 191 can generate a vibration prompt. The indicator 192 can be an indicator light, which can be used to indicate the charging state, the change in battery power, and can also be used to indicate messages, missed calls, notifications, etc.
[0104] The SIM card interface 195 is used to connect to the SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to achieve contact and separation from the electronic device 100. The electronic device 100 can support one or N SIM card interfaces, where N is a positive integer greater than 1. The electronic device 100 interacts with the network through the SIM card to achieve functions such as calls and data communication. In some examples, the electronic device 100 uses an eSIM, that is, an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
[0105] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservices architecture, or a cloud architecture. In the embodiments of this application, taking the system of the layered architecture as an example, the software structure of the electronic device 100 will be exemplarily described.
[0106] Figure 4 The software structure block diagram of the electronic device 100 provided in this application is exemplarily shown.
[0107] The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the system is divided into four layers, from top to bottom are the application layer, the application framework layer, Android Runtime and system libraries, and the kernel layer.
[0108] The application layer may include a series of application packages.
[0109] As Figure 4 shown, the application packages may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, and short message.
[0110] The application framework layer provides APIs and programming frameworks for the applications in the application layer. The application framework layer includes some predefined functions.
[0111] As Figure 4 shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, an activity manager, a camera output module, a combined decision module for camera cover and focus motor, etc.
[0112] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0113] The content provider is used to store and retrieve data and make this data accessible to applications. The data may include videos, images, audio, incoming and outgoing calls, browsing history and bookmarks, phone books, etc.
[0114] The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build applications. The display interface can be composed of one or more views. For example, a display interface including a text message notification icon may include a view for displaying text and a view for displaying pictures.
[0115] The phone manager is used to provide the communication functions of the electronic device 100. For example, the management of call states (including answering, hanging up, etc.).
[0116] The resource manager provides various resources for applications, such as localized strings, icons, pictures, layout files, video files, and so on.
[0117] The notification manager enables applications to display notification information in the status bar (such as the pull-down notification bar). It can be used to convey notification-type messages, which can disappear automatically after a short stay without user interaction. For example, the notification manager is used to inform that the download is completed, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as the notification of a background-running application, or a notification that appears in the form of a dialogue window on the screen. For example, it can prompt text information in the status bar, emit a prompt tone, vibrate the electronic device, blink the indicator light, etc.
[0118] The activity manager is responsible for managing activities, including starting, switching, scheduling of various components in the system, as well as the management and scheduling of applications. The activity manager can be called by upper-layer applications to open the corresponding activity.
[0119] The camera image output module can be used to convert the data collected by the camera module into an image. For example, the camera image output module can obtain the electrical signals generated by the photosensitive sensor in the camera module and generate an image based on the above electrical signals. In some embodiments, the camera image output module can perform one or more processes on the image, such as cropping, noise optimization, brightness optimization, filter adjustment, etc. Among them, when the focusing motor in the camera module moves to the target position of the focusing motor, the camera image output module can generate a clear image of the focusing object. The camera image output module can send the generated image to the camera application, and the camera application can display it in real time on the shooting interface.
[0120] The camera cover and focus motor joint decision-making module can be used to make decisions on the movement of the camera cover and the focus motor, so as to achieve the goals of improving the focusing speed and reducing the collision between the camera cover and the focus motor. Among them, the camera cover and focus motor joint decision-making module can obtain the position of the camera cover movement at regular intervals, and decide how the focus motor moves based on the position where the camera cover is located. If the target position of the focus motor is less than the safe position corresponding to the position where the camera cover is located, the camera cover and focus motor decision-making module can instruct the focus motor to move to the target position of the focus motor. If the target position of the focus motor is greater than the safe position corresponding to the position where the camera cover is located, the camera cover and focus motor decision-making module can instruct the focus motor to move to the safe position corresponding to the position where the camera cover is located, and wait for the camera cover to move for a period of time before continuing to move the focus motor. This can quickly move the focus motor to the target position of the focus motor on the basis of reducing the collision between the focus motor and the camera cover, and improve the focusing speed.
[0121] The Android Runtime includes core libraries and a virtual machine. The Android Runtime is responsible for the scheduling and management of the Android system.
[0122] The core libraries include two parts: one part is the functional functions that the Java language needs to call, and the other part is the core libraries of Android.
[0123] The application layer and the application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as the management of object life cycles, stack management, thread management, security and exception management, and garbage collection.
[0124] The system libraries can include multiple functional modules. For example: surface manager, Media Libraries, 3D graphics processing libraries (such as: OpenGL ES), 2D graphics engine (such as: SGL), etc.
[0125] The surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications.
[0126] The media libraries support the playback and recording of a variety of common audio and video formats, as well as static image files, etc. The media libraries can support a variety of audio and video coding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0127] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing, etc.
[0128] The 2D graphics engine is a graphics engine for 2D drawing.
[0129] The kernel layer is the layer between hardware and software. The kernel layer includes at least a display driver, a camera driver, an audio driver, and a sensor driver.
[0130] Figures 5 to 7 Exemplary schematic diagrams of some focusing scenarios are shown.
[0131] As Figure 5 shown, when the camera application is not turned on, both the focusing motor and the camera cover are in their initial positions. For example, the initial position of the camera cover can be the position of the battery cover. In some embodiments, when both the focusing motor and the camera cover are in their initial positions, the camera cover and the focusing motor do not protrude or slightly protrude on the back of the electronic device 100.
[0132] At time t1, the electronic device 100 turns on the camera application. Among them, the electronic device 100 can turn on the camera application in response to an operation on the camera application icon. Alternatively, the electronic device 100 can also turn on the camera application according to a request from other applications to call the camera application. For example, applications such as a barcode payment application and a video call application can request to call the camera application to implement corresponding functions. Embodiments of the present application do not limit the trigger condition for the electronic device 100 to turn on the camera application.
[0133] When the camera application is turned on, the electronic device 100 can determine the target position X for the movement of the focusing motor. In some embodiments, the electronic device 100 may preset the initial target position of the focusing motor after the camera application is turned on. The electronic device 100 can use the above initial target position as the target position X. In some embodiments, the electronic device 100 can identify the first frame image or multiple previous frame images collected after the camera application is turned on, and use the above first frame image or multiple previous frame images to determine the target position X. Embodiments of the present application do not limit the method for determining the target position X.
[0134] When the camera application is turned on, the electronic device 100 can start moving the camera cover in the direction of the target position Y where the camera cover moves. Among them, the target position Y where the camera cover moves can be preset and is the farthest position that the camera cover can move. The electronic device 100 can move the camera cover to the farthest position it can reach after turning on the camera application and keep it at the farthest position before the camera application is turned off. This can give the focusing motor sufficient moving space during shooting and improve the focusing effect of the electronic device 100. Due to the structural design of the camera cover itself and considering factors such as noise during the movement of the camera cover, the moving speed of the camera cover is slow. In some embodiments, the camera cover can move towards the target position Y at a preset speed. Optionally, the moving speed of the camera cover can remain unchanged.
[0135] When the camera application is launched, the electronic device 100 can detect the position where the camera cover moves at regular intervals. Among them, the electronic device 100 can detect the position where the camera cover moves regularly or irregularly. That is, the time period between two adjacent detections by the electronic device 100 of the position where the camera cover moves can be of a fixed duration, or it can also be of a non-fixed duration. For example, the electronic device 100 can detect the position where the camera cover moves every preset duration. The above-mentioned preset duration can take values such as 15 milliseconds (ms), 30 ms, 40 ms, etc. The embodiments of the present application do not limit the value of the above-mentioned preset duration.
[0136] In some embodiments, when the camera application is launched, in addition to moving the camera cover, the electronic device 100 can also start moving the focus motor. Among them, since the object distance of the focus object may change at any time during the shooting process, the electronic device 100 needs to quickly adjust the distance to achieve focus. The moving speed of the focus motor is relatively fast. The moving speed of the focus motor is usually faster than that of the camera cover. The time when the focus motor starts to move can be later than the time when the camera cover starts to move. For example, when the camera application is launched, the electronic device 100 can start moving the camera cover. When the camera cover has moved for 10 ms, the electronic device 100 can start moving the focus motor. The embodiments of the present application do not limit the duration by which the camera cover moves earlier than the focus motor. Since the moving speed of the focus motor is faster than that of the camera cover, the camera cover starting to move a short period of time earlier than the focus motor can better avoid the camera cover colliding with the focus motor.
[0137] Alternatively, when the camera application is launched, the camera cover and the focus motor can start moving simultaneously. Among them, when the distance between the focus motor and the camera cover is greater than the first distance, no collision will occur between the focus motor and the camera cover. That is, the above-mentioned first distance can be the distance at which no collision occurs between the camera module and the camera cover. The above-mentioned first distance can depend on the structural designs of the camera cover, the lens, and the focus motor. The embodiments of the present application do not limit the size of the above-mentioned first distance. When the camera application has not been launched, the distance between the focus motor and the camera cover may be much greater than the above-mentioned first distance. Therefore, when the electronic device 100 starts moving the camera cover and the focus motor simultaneously for a period of time after launching the camera application, the situation where the focus motor collides with the camera cover usually does not occur. The focus motor and the camera cover starting to move simultaneously can better shorten the time for the focus motor to move to the target position of the focus motor and improve the focusing efficiency.
[0138] Alternatively, during the time period from when the camera application is launched to before the position where the camera cover moves is detected for the first time, the electronic device 100 can only move the camera cover and keep the focus motor stationary at the initial position.
[0139] In some embodiments, without being limited to determining the target position of the focusing motor, after the camera application is launched, the electronic device 100 can determine the target position of other components in the camera module that need to move during focusing. Then, the electronic device 100 can control the movement of the focusing motor according to the movement of the camera cover, so that other components in the camera module reach the corresponding target positions. For example, after the camera application is launched, the electronic device 100 can determine the target position of the lens. The electronic device 100 can control the movement of the focusing motor according to the movement of the camera cover, so that the lens moves to the target position of the lens.
[0140] With reference to the first distance between the focusing motor and the camera cover, when the target positions of other components outside the focusing motor are obtained, the electronic device 100 can acquire the distance that the component needs to maintain from the camera cover. In this way, during the process of moving the focusing motor to make the component move to the target position of the component, the electronic device 100 can control the movement of the focusing motor in combination with the distance that the component needs to maintain from the camera cover, so as to reduce the collision between the camera module and the camera cover. In the subsequent embodiments of this application, the target position of the focusing motor and the first distance are taken as examples for illustration.
[0141] As Figure 5 shown, at time t2, the electronic device 100 can detect the position where the camera cover moves. At time t2, the camera cover moves to position Y1. The electronic device 100 can determine whether the sum of the target position X of the focusing motor and the first distance is greater than Y1, that is, determine whether the distance between the target position X and the position Y1 is greater than the first distance. If the sum of the target position X and the first distance is greater than Y1, the focusing motor cannot directly move to the target position X currently, otherwise there may be a collision with the camera cover. Therefore, when the sum of the target position X and the first distance is greater than Y1, the electronic device 100 can move the focusing motor to position X1. Position X1 is the position where Y1 minus the first distance. That is, position X1 is the safe position corresponding to position Y1. In some embodiments, the distance between the safe position corresponding to position Y1 and position Y1 can also be greater than the first distance. Position X1 can be a position farther from position Y1 than the position where Y1 minus the first distance.
[0142] In some embodiments, the camera cover moving to position Y1 can mean that the top of the camera cover moves to position Y1 (refer to Figure 5 ). The camera cover is a lifting device, and the top of the camera cover is the frontmost position of the camera cover during the lifting process. Optionally, the camera cover has a certain thickness. The camera cover moving to position Y1 can also mean that any part of the camera cover moves to position Y1. In this application, the reference part used for the camera cover to move to different positions at different times can be the same. That is, the camera cover moving to different positions at different times can mean that a part of the camera cover moves to these different positions at different times.
[0143] The above-mentioned time t2 may be the moment when the electronic device 100 first detects the moving position of the camera cover after starting the camera application. The electronic device 100 may move the focusing motor to the safe position corresponding to the above-mentioned position Y1 (i.e., position X1) between the first detection and the second detection, and continue to move the camera cover.
[0144] As Figure 5 shown, the electronic device 100 may detect the moving position of the camera cover for the second time at time t3. At time t3, the camera cover moves to position Y2, and Y2 is greater than Y1. That is, the camera cover moves in the direction of the target position Y during the time period from time t2 to time t3. In addition, at time t3, the focusing motor has moved to position X1. In some embodiments, the focusing motor may move to position X1 during the time period from time t2 to time t3 when the camera cover moves. When moving to position X1, the focusing motor may stop moving and wait to determine how to move the focusing motor when detecting the moving position of the camera cover next time. For example, if the focusing motor moves to position X1 at a moment between time t2 and time t3, the focusing motor may temporarily stop moving after reaching position X1. The electronic device 100 may determine how to move the focusing motor according to the moving position of the camera cover at time t3.
[0145] In some embodiments, the focusing motor has a certain thickness. The focusing motor moving to position X1 may mean that the top of the focusing motor moves to position X1, or it may mean that the bottom of the focusing motor moves to position X1. The embodiments of the present application do not limit this. That is, the focusing motor moving to position X1 may mean that any part on the focusing motor moves to position X1. In the present application, the reference part used by the focusing motor to move to different positions at different times may be the same. That is, the focusing motor moving to different positions at different times may mean that a part on the focusing motor moves to these different positions at different times.
[0146] The electronic device 100 may determine whether the sum of the target position X of the focusing motor and the first distance is greater than Y2, that is, determine whether the distance between the target position X and the position Y1 is greater than the first distance. If the sum of the target position X and the first distance is less than or equal to Y2, the focusing motor may currently move directly to the target position X without colliding with the camera cover. Therefore, when the sum of the target position X and the first distance is less than or equal to Y2, the electronic device 100 may move the focusing motor to the target position X.
[0147] If the position Y2 is less than the target position Y, the camera cover may continue to move after moving to the position Y2 at time t3.
[0148] As Figure 5As shown, the electronic device 100 can detect the position where the camera cover moves for the third time at time t4. At time t4, the camera cover moves to position Y3, the focusing motor has moved to the target position X, and the sum of the target position X and the first distance is less than Y3. After the focusing motor moves to the target position X, it can remain stationary. Among them, if the camera cover has not moved to the target position Y at time t4, the camera cover can continue to move towards the target position Y until it moves to the target position Y.
[0149] It should be noted that the duration of the time period between t1 and t2 above can be the same as the duration of the time period between t2 and t3, or they can also be different.
[0150] In some embodiments, during the process of the focusing motor moving to the safe position corresponding to the position where the camera cover was located during the previous detection, the camera cover is also continuing to move. When the focusing motor moves to the safe position corresponding to the position where the camera cover was located during the previous detection, the electronic device 100 can detect the latest position where the camera cover moves, and then adjust the position of the focusing motor according to this latest position. That is to say, the moment when the electronic device 100 detects the position of the camera cover can include the moment when the focusing motor moves to the safe position corresponding to the position where the camera cover was located during the previous detection. For example, in the above Figure 5 example, the above time t3 can be the moment when the focusing motor moves to position X1. This can reduce the time for the focusing motor to wait for the next detection after moving to the safe position corresponding to the position of the camera cover one or more times before moving to the target position X. The above embodiments can improve the focusing efficiency and make the focusing motor move to the target position X faster while reducing the collision between the focusing motor and the camera cover.
[0151] As Figure 6 shown, after the electronic device 100 turns on the camera application at time t1, it can determine that the target position for the focusing motor to move is position X'. The electronic device 100 can detect that the camera cover moves to position Y1 at time t2. When it is determined that the sum of the target position X' and the first distance is less than or equal to Y1, the electronic device 100 can move the focusing motor towards the target position X'. In addition, the electronic device 100 can continue to move the camera cover.
[0152] As Figure 6 shown, at time t3, the camera cover moves to position Y2, and the focusing motor has moved to the target position X'. The sum of the target position X' and the first distance is less than Y2. If position Y2 is less than the target position Y where the camera cover moves, the camera cover can continue to move. For example, after time t3, the camera cover can continue to move towards the target position Y and move to position Y3 at time t4. Among them, when the target position where the focusing motor moves remains unchanged, the focusing motor can stay at the target position X'.
[0153] As described above Figure 5 and Figure 6 it can be seen that the electronic device 100 can detect the position of the camera cover multiple times. During the process of detecting the position of the camera cover multiple times, when the distance between the detected position of the camera cover and the target position of the focusing motor is less than the first distance, the electronic device 100 can move the focusing motor to the safe position corresponding to the position where the camera cover is located during this detection, and continue the subsequent detection. When the distance between the detected position of the camera cover and the target position of the focusing motor is greater than or equal to the first distance, the electronic device 100 can move the focusing motor to the target position of the focusing motor to complete focusing.
[0154] In some embodiments, during the movement of the camera cover, it may move in the direction of the focusing motor and then move backward. For example, when the camera cover is subjected to an external force, it may be pushed by the external force in the direction of the focusing motor, or it may be stuck before reaching the target position of the camera cover and cannot continue to move towards the target position of the camera cover. Or, the electronic device 100 may malfunction, resulting in the camera cover moving backward instead of forward and moving in the direction of the focusing motor. The camera cover moves in the direction of the focusing motor, and the focusing motor moves in the direction of the target position of the focusing motor. This will cause the relative movement between the camera cover and the focusing motor, and the camera cover may collide with the focusing motor, hindering the focusing motor from moving to the target position of the focusing motor. The electronic device 100 can, according to the relative position relationship between the camera cover and the focusing motor, move the focusing motor away from the camera cover when a collision occurs between the focusing motor and the camera cover, so as to reduce the collision between the two.
[0155] Here, still taking the target position of the movement of the focusing motor as position X and the target position of the movement of the camera cover as position Y as an example for illustration.
[0156] As Figure 7 shown, the electronic device 100 turns on the camera application at time t1, determines the target position X of the movement of the focusing motor, and moves the camera cover. The electronic device 100 detects the position of the camera cover for the first time at time t2. At time t2, the camera cover moves to position Y1, and the sum of the target position X and the first distance is greater than Y1. The electronic device 100 can move the focusing motor to position X1. Position X1 is the position where Y1 minus the first distance. Optionally, the distance between the safe position corresponding to position Y1 and position Y1 can also be greater than the first distance. That is, position X1 can be a position farther from position Y1 than the position where Y1 minus the first distance. The specific states of the camera cover and the focusing motor at time t1 and time t2 can specifically refer to the introduction of the foregoing Figure 5 embodiment.
[0157] The electronic device 100 detects the position of the camera cover for the second time at time t3. At time t3, the camera cover moves to position Y2'. The electronic device 100 can determine that Y2' is less than Y1. That is, the camera cover moves in the direction of the focusing motor during the time period between time t2 and time t3. During the time period between time t2 and time t3, the focusing motor moves in the direction of the camera cover and needs to move to position X1. Since the camera cover and the focusing motor move relative to each other, it is possible that the focusing motor collides with the camera cover before it moves to position X1, or the focusing motor may have moved to position X1 and collides with the camera cover that moves backward.
[0158] The electronic device 100 can determine position X2 based on position Y2'. X2 is the position obtained by subtracting the first distance from Y2'. That is, position X2 is the safe position corresponding to position Y2'. The electronic device 100 can move the focusing motor to position X2. Optionally, the distance between the safe position corresponding to position Y2' and position Y2' can also be greater than the first distance. That is, position X2 can be a position farther from position Y2' than the position obtained by subtracting the first distance from Y2'.
[0159] As Figure 7 shown, the electronic device 100 detects the position of the camera cover for the third time at time t4. At time t4, the camera cover moves to position Y3'. The electronic device 100 can determine that Y3' is greater than Y2'. That is, the camera cover moves toward the target position Y during the time period between time t3 and time t4. The electronic device 100 can determine whether the sum of the target position X and the first distance is less than Y3'. When the sum of the target position X and the first distance is less than or equal to Y3', the electronic device 100 can move the focusing motor to the target position X. In addition, when the camera cover has not moved to the target position Y, the electronic device 100 can continue to move the camera cover toward the target position Y.
[0160] The electronic device 100 detects the position of the camera cover for the fourth time at time t5. At time t5, the camera cover moves to position Y4, and the focusing motor has moved to the target position X. The sum of the target position X and the first distance is less than Y4. In this way, the camera application completes the first focusing after being turned on.
[0161] From the above Figure 7 it can be seen that the electronic device 100 can detect whether the camera cover moves in the direction of the focusing motor during the movement of the camera cover. When it detects that the camera cover moves in the direction of the focusing motor, the electronic device 100 can adjust the position of the focusing motor and move the focusing motor in the direction away from the camera cover to reduce the situation of collision between the focusing motor and the camera cover.
[0162] In some embodiments, when the camera application is turned on and the camera cover moves in the direction of the focus motor, the electronic device 100 may display a prompt message on the screen to prompt the user that there is an abnormality in the movement of the camera cover. For example, the movement of the camera cover in the direction of the focus motor may be caused by the user accidentally touching the camera cover. The above prompt message for prompting the user that there is an abnormality in the movement of the camera cover can reduce the situation where the camera cover collides with the focus motor due to the user accidentally touching the camera cover. The present application does not limit the specific content of the above prompt message. For example, the above prompt message may include, but is not limited to, content for prompting the user to check whether the camera cover is blocked or stuck by an obstacle, content for prompting the user to restart the camera application, and so on.
[0163] In some embodiments, the target position of the focus motor movement can change with the object distance of the focus object. Moreover, in response to a user operation for switching the focus object, the electronic device 100 can also update the target position of the focus motor movement according to the object distance of the switched focus object. When the camera application is turned on, the electronic device 100 can determine the initial target position of the focus motor. Before the focus motor moves to the initial target position, if the target position of the focus motor is updated, the electronic device 100 can use the updated target position as the standard and move the focus motor to the updated target position.
[0164] Exemplarily, when the camera application is turned on, the electronic device 100 can determine that the initial target position of the focus motor is position X. Referring to the foregoing Figure 5 as shown, the electronic device 100 moves the focus motor towards position X1 between time t2 and time t3. That is, the focus motor has not yet moved to the target position X. Between time t2 and time t3, the electronic device 100 detects an event for updating the target position of the focus motor. This event may be triggered by a change in the position of the focus object resulting in a change in the object distance, or may be triggered by a user operation for switching the focus object. The present application embodiments do not limit the triggering conditions of the above event for updating the target position of the focus motor.
[0165] For example, the target position of the focus motor is updated from position X to 2X.
[0166] In the case where the target position of the focus motor is updated to 2X, at time t3 shown in the foregoing Figure 5 as shown, the electronic device 100 can determine whether the sum of the updated target position 2X and the first distance is less than Y2. If the sum of the target position 2X and the first distance is greater than Y2, the electronic device 100 can move the focus motor to the safe position corresponding to position Y2. The safe position corresponding to position Y2 may be the position of Y2 minus the first distance.
[0167] Further, in the foregoing Figure 5At the moment t4 shown in the figure, the electronic device 100 detects that the camera cover moves to the position Y3. When Y3 is greater than Y2, the electronic device 100 can determine whether the sum of the target position 2X and the first distance is less than Y3. If the sum of the target position 2X and the first distance is less than or equal to Y3, the electronic device 100 can move the focusing motor to the target position 2X. If the sum of the target position 2X and the first distance is greater than Y3, the electronic device 100 can move the focusing motor to the safe position corresponding to the position Y3, and continue to detect the position of the camera cover subsequently, and then move the focusing motor according to the position of the camera cover, so as to quickly move the focusing motor to the target position 2X of the focusing motor on the basis of reducing the collision between the focusing motor and the camera cover.
[0168] For another example, the position of the focusing motor is updated from the position X to X / 2.
[0169] In the foregoing Figure 5 After the electronic device 100 detects that the camera cover moves to the position Y1 at the moment t2 shown in the figure, the electronic device 100 can move the focusing motor to the safe position X1 corresponding to the position Y1. If within the time period between the moment t2 and the moment t3, the electronic device 100 determines that the target position of the focusing motor is updated to X / 2, the electronic device 100 can determine whether the sum of the target position X / 2 and the first distance is less than Y1. If the sum of the target position X / 2 and the first distance is less than or equal to Y1, the electronic device 100 can adjust the position of the focusing motor and move the focusing motor to the updated target position X / 2. In this way, at the moment t3 shown in the figure above Figure 5 the focusing motor can be in a state where it has moved to the target position X / 2, or in a state where it is about to move to the target position X / 2. The electronic device 100 does not need to compare the position Y2 where the camera cover moves at the moment t3 with the target position of the focusing motor any more.
[0170] Alternatively, when the target position of the focusing motor is updated to X / 2 within the time period between the moment t2 and the moment t3, the electronic device 100 can still continue to move the focusing motor to the safe position X1 corresponding to the position Y1. After the electronic device 100 detects that the camera cover moves to the position Y2 at the moment t3, it can determine whether the sum of the updated target position X / 2 of the focusing motor and the first distance is less than Y2. If the sum of the target position X / 2 and the first distance is less than or equal to Y2, the electronic device 100 can move the focusing motor from the position X1 to the target position X / 2.
[0171] That is to say, when the target position of the focusing motor is detected to be updated, the electronic device 100 can immediately adjust the position of the focusing motor according to the relative position relationship between the position of the camera cover detected most recently and the updated target position of the focusing motor. Alternatively, the electronic device 100 can adjust the position of the focusing motor according to the relative position relationship between the position of the camera cover and the updated target position of the focusing motor when detecting the position of the camera cover next time.
[0172] Figure 8 An exemplary flowchart of a focusing method provided by this application is shown.
[0173] As Figure 8 shown, the method may include steps S811 to S821.
[0174] S811. Start the camera application.
[0175] S812. Determine the target position X for the focusing motor to move and move the camera cover.
[0176] Steps S811 and S812 may refer to the introduction of the electronic device 100 turning on the camera application at time t1 as described above. Figure 5 shown.
[0177] S813. Detect that the camera cover has moved to position Y1.
[0178] S814. Determine whether the distance between X and Y1 is less than a first distance.
[0179] The distance between the focusing motor and the camera cover being greater than or equal to the first distance can prevent the camera cover from colliding with the camera module. The first distance can represent the safe distance between the focusing motor and the camera cover.
[0180] After starting the camera application, the electronic device 100 can detect the position of the camera cover at regular intervals. When detecting that the camera cover has moved to position Y1, the electronic device 100 can determine whether the distance between X and Y1 is less than the first distance. The distance between the target position X and Y1 being less than the first distance can indicate that the focusing motor moving to the target position X may cause the camera module to collide with the camera cover at this time. The distance between the target position X and Y1 being greater than or equal to the first distance can indicate that the focusing motor moving to the target position X will not cause the camera module to collide with the camera cover at this time.
[0181] If the distance between X and Y1 is greater than or equal to the first distance, the electronic device 100 can execute step S815.
[0182] If the distance between X and Y1 is less than the first distance, the electronic device 100 can execute step S816.
[0183] S815. Continue to move the camera cover towards the target position Y and move the focusing motor towards the target position X.
[0184] The movement of the focusing motor to the target position X can indicate that focusing is completed. After the focusing motor moves to the target position X, the camera cover can continue to move until it reaches the target position Y.
[0185] S816. Continue to move the camera cover towards the target position Y and move the focusing motor towards the position X1, where the distance between X1 and Y1 is greater than or equal to the first distance.
[0186] Since the distance between X1 and Y1 is greater than or equal to the first distance, the movement of the focusing motor to the position X1 will not cause the camera module to collide with the camera cover. The position X1 can be determined based on the position Y1. The position X1 can also be referred to as the safe position corresponding to the position Y1.
[0187] S817. Detect that the camera cover has moved to the position Y2.
[0188] After detecting that the camera cover has moved to the position Y1, the electronic device 100 can wait for a period of time and then detect the position of the camera cover again, and detect that the camera cover has moved to the position Y2. During the period when the camera cover moves from the position Y1 to the position Y2, the focusing motor may have moved to the position X1, or may not have moved to the position X1 yet.
[0189] S818. Determine whether Y1 is less than Y2.
[0190] The electronic device 100 can determine the distance between the positions of the camera cover detected twice in succession. For example, the electronic device 100 can determine whether Y1 is less than Y2. Y1 being less than Y2 can indicate that the camera cover is moving towards the direction of the target position Y of the camera cover, that is, during the process of moving from the position Y1 to the position Y2, the camera cover moves to a position farther from the initial position of the camera cover. Y1 being greater than Y2 can indicate that the camera cover is moving towards the direction of the focusing motor, that is, during the process of moving from the position Y1 to the position Y2, the camera cover moves to a position closer to the initial position of the camera cover.
[0191] If Y1 is less than Y2, the distance between the camera cover and the focusing motor increases, and the electronic device 100 can continue to move the focusing motor so that the focusing motor is closer to the target position X of the focusing motor without colliding with the camera cover. When it is determined that Y1 is less than Y2, the electronic device 100 can execute step S819.
[0192] If Y1 is greater than Y2, the distance between the camera cover and the focusing motor decreases, and there may even be a situation where the camera cover collides with the focusing motor. When it is determined that Y1 is greater than Y2, the electronic device 100 can execute step S820.
[0193] If Y1 is equal to Y2, the camera cover stays at position Y1 without moving. Therefore, the above-mentioned position X1 is also the safe position corresponding to position Y2. After the focusing motor moves to position X1, it can stay still temporarily to avoid colliding with the camera cover.
[0194] S819. Determine whether the distance between X and Y2 is less than the first distance.
[0195] The distance between the target position X and Y2 being less than the first distance may indicate that when the focusing motor moves to the target position X, the camera module may collide with the camera cover. The distance between the target position X and Y2 being greater than or equal to the first distance may indicate that when the focusing motor moves to the target position X, the camera module will not collide with the camera cover.
[0196] If the distance between X and Y2 is greater than or equal to the first distance, the electronic device 100 may execute the above-mentioned step S815. If the distance between X and Y2 is less than the first distance, the electronic device 100 may execute the following step S820.
[0197] S820. Continue to move the camera cover towards the target position Y, and move the focusing motor towards position X2, where the distance between X2 and Y2 is greater than or equal to the first distance.
[0198] Since the distance between X2 and Y2 is greater than or equal to the first distance, when the focusing motor moves to position X2, the camera module will not collide with the camera cover. Position X2 can be determined according to position Y2. Position X2 can also be referred to as the safe position corresponding to position Y2.
[0199] In the case where Y1 is greater than Y2, position X2 is closer to the initial position of the focusing motor than position X1. Therefore, in the case where Y1 is greater than Y2, moving the focusing motor towards position X2 can be moving in a direction away from the camera cover. This can reduce the situation of the focusing motor colliding with the retracting camera cover. For details, reference can be made to the description of the movement of the camera cover and the focusing motor from the aforementioned Figure 7 shown at time t2 to time t3.
[0200] In the case where Y1 is less than Y2, position X2 is farther from the initial position of the focusing motor than position X1. Therefore, in the case where Y1 is less than Y2, moving the focusing motor towards position X2 can be moving in a direction closer to the target position of the focusing motor. In this way, the focusing motor can gradually approach the target position of the focusing motor to complete focusing without colliding with the camera cover as the camera cover moves.
[0201] S821. Detect the position of the camera cover at regular intervals, and move the focusing motor according to the relationship between the position of the camera cover and the target position X, so that the focusing motor moves to the target position X.
[0202] After detecting that the camera cover has moved to position Y2, the electronic device 100 may wait for a period of time and then detect the position of the camera cover again. Then, the electronic device 100 may determine how to move the focus motor according to the relative position relationship between the position of the camera cover detected most recently and the position of the camera cover detected last time, as well as the relative position relationship between the position of the camera cover detected most recently and the target position of the focus motor. Specifically, reference may be made to steps S817-S820 above.
[0203] The above method can gradually move the focus motor to the target position of the focus motor while reducing the collision between the camera cover and the focus motor during the movement of the camera cover. This can not only reduce the situation of collision between the camera cover and the focus motor, but also improve the focusing efficiency after the camera application is started. The electronic device 100 can quickly complete focusing after starting the camera application by using the above method, so as to realize that the first multiple frames of images displayed after the camera application is started are clear images of the focusing object.
[0204] In some embodiments, during the entire process when the camera application of the electronic device 100 is in the on state, the position of the camera cover may be detected at regular intervals, and the relative position relationship between the position of the camera cover and the target position of the focus motor may be compared. If the gap between the position of the camera cover and the target position of the focus motor is less than the first distance, the electronic device 100 may move the focus motor to the safe position corresponding to the current position of the camera cover, or move the focus motor back to the initial position of the focus motor. This can reduce the collision between the focus motor and the camera cover. If the gap between the position of the camera cover and the target position of the focus motor is greater than or equal to the first distance, the electronic device 100 may quickly move the focus motor to the target position of the focus motor to achieve focusing.
[0205] The above embodiments can reduce the situation of collision between the camera cover and the focus motor caused by abnormal movement of the camera cover (i.e., before the camera application is closed, the camera cover retreats and moves in the direction of the initial position of the camera cover) during the entire process of using the camera application to take pictures.
[0206] In some embodiments, the electronic device 100 may stop detecting the position of the camera cover after the camera cover has moved to the target position of the camera cover. It can be understood that the target position of the camera cover is the farthest position that the camera cover can move. When the camera cover is at the target position of the camera cover, it will not collide with the focus motor. The electronic device 100 may directly move the focus motor to the target position of the focus motor. The above embodiments can save the power consumption of the electronic device 100.
[0207] It should be noted that, without contradiction or conflict, any feature in any embodiment of the present application, or any part of any feature, can be combined, and the combined technical solution is also within the scope of the embodiments of the present application.
[0208] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the various embodiments of the present application.
Claims
1. A focusing method, characterized in that, The method is applied to an electronic device, the electronic device includes a camera module and a camera cover, the camera module includes a focusing motor, and the method includes: The electronic device turns on the camera application and determines a first target position to which the focusing motor moves; The electronic device moves the camera cover; When the camera cover moves to a first position and the distance between the first position and the first target position is greater than or equal to a first distance, the electronic device moves the focusing motor to the first target position, where the first position is less than the target position of the camera cover.
2. The method according to claim 1, characterized in that, Before the camera cover moves to the first position, the method further includes: When the camera cover moves to a second position and the distance between the second position and the first target position is less than the first distance, the electronic device moves the focusing motor to a third position, and the distance between the second position and the third position is greater than or equal to the first distance.
3. The method according to claim 2, characterized in that Before the camera cover moves to the first position, the method further includes: During the process of the focusing motor moving to the third position, the electronic device continues to move the camera cover; When the camera cover moves to a fourth position and the distance between the fourth position and the third position is less than the first distance, the electronic device moves the focusing motor to a fifth position, and the distance between the fourth position and the fifth position is greater than or equal to the first distance.
4. The method according to claim 3, characterized in that, After the camera cover moves to the fourth position, the method further includes: The electronic device displays a first prompt message for prompting the user that an abnormality occurs in the movement of the camera cover.
5. The method according to claim 2, wherein Before the camera cover moves to the first position, the method further includes: During the process of the focusing motor moving to the third position, the electronic device continues to move the camera cover; When the camera cover moves to a sixth position, the distance between the sixth position and the third position is greater than the distance between the second position and the third position, and the distance between the sixth position and the first target position is less than the first distance, the electronic device moves the focusing motor to a seventh position, and the distance between the sixth position and the seventh position is greater than or equal to the first distance.
6. The method according to claim 5, wherein Before the camera cover moves to the sixth position, the method further includes: When the focusing motor moves to the third position, the electronic device pauses moving the focusing motor.
7. The method according to any one of claims 1 to 6, characterized in that After the electronic device turns on the camera application, the method further includes: The electronic device starts to move the focusing motor after a first time period from starting to move the camera cover, or starts to move the camera cover and the focusing motor simultaneously.
8. The method according to any one of claims 1-7, characterized in that, After the camera cover moves to the first position, the method further includes: The electronic device continues to move the camera cover until the camera cover is moved to the target position of the camera cover.
9. The method according to claim 8, wherein After moving the camera cover to the target position of the camera cover, the method further includes: The electronic device keeps the camera cover at the target position of the camera cover; When the target position to which the focusing motor moves changes from the first target position to the third target position, the electronic device moves the focusing motor to the third target position.
10. The method according to any one of claims 1-9, characterized in that, The first distance is the safety distance between the focusing motor and the camera cover.
11. An electronic device, characterized in that, The electronic device includes a camera module, a camera cover, a memory, and a processor. Among them, the camera module is used for taking pictures. The camera module includes a lens and a focusing motor, and the focusing motor is used to push the lens to achieve focusing; the camera cover is used to provide space for the movement of the camera module and protect the internal structure of the electronic device; the memory is used to store computer programs; the processor is used to call the computer programs so that the electronic device executes the method described in any one of claims 1-10.
12. A computer-readable storage medium stores instructions, characterized in that, When the instruction runs on the electronic device, the electronic device executes the method described in any one of claims 1-10.
13. A computer program product, characterized in that, The computer program product contains computer instructions. When the computer instructions run on the electronic device, the electronic device executes the method described in any one of claims 1-10.
Citation Information
Cited By
Focusing method and electronic device
EP4741919A1
Focusing method and electronic device
WO2025140659A1