FOCUSING METHOD AND ELECTRONIC DEVICE

RU2026105122APending Publication Date: 2026-06-29HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
RU · RU
Patent Type
Applications
Current Assignee / Owner
HUAWEI TECH CO LTD
Filing Date
2024-12-28
Publication Date
2026-06-29

AI Technical Summary

Technical Problem

In the prior art, the focus speed of the camera application of electronic devices is slow after opening, and the focus motor and the camera cover are prone to collision, affecting the user experience.

Method used

By dynamically adjusting the movement trajectory of the focus motor according to the movement of the camera cover, balance the relative position between the camera cover and the focus motor, avoid collisions, and detect its position multiple times during the movement of the camera cover to adjust the position of the focus motor, ensuring fast focus.

Benefits of technology

It realizes fast focus after the camera application is turned on, reduces the collision between the focus motor and the camera cover, and improves the focus efficiency and user experience.

✦ Generated by Eureka AI based on patent content.
Patent Text Reader

Abstract

A focusing method and an electronic device (100), wherein the electronic device (100) comprises a camera cover, which is capable of moving independently of a camera module. The electronic device (100) can dynamically adjust a moving track of a focusing motor on the basis of the movement of the camera cover, balance the relative position between the camera cover and the focusing motor, realize quick focusing after a camera application is started, and reduce collision between the focusing motor and the camera cover.
Need to check novelty before this filing date? Find Prior Art

Description

Focusing method and electronic equipment

[0001] This application claims priority to the Chinese patent application with application number 202311866430.7 filed with the State Intellectual Property Office of China on December 29, 2023, and priority to the Chinese patent application with the invention name “A focusing method and electronic device”, all contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of terminal technology, and in particular to a focusing method and electronic equipment. Background Art

[0003] Users are increasingly demanding camera applications in mobile phones and other electronic devices. For example, users expect quick and accurate focus upon opening a camera application. The camera module of an electronic device consists of a lens and a focus motor. This motor drives the lens to achieve focus. However, since the focus motor takes time to move the lens to the target position, the camera application's focus speed is slow. Summary of the Invention

[0004] This application provides a focusing method and electronic device. This method can move a focus motor according to the movement of a camera cover, balance the relative position between the camera cover and the focus motor, achieve rapid focus after the camera application is turned on, and reduce collisions between the focus motor and the camera cover.

[0005] In a first aspect, the present application provides a focusing method. The method can be applied to an electronic device, the electronic device comprising a camera module and a camera cover, the camera module comprising a focus motor. The electronic device activates a camera application and determines a first target position for movement of the focus motor; 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 focus motor to the first target position, wherein the first position is smaller than the target position of the camera cover.

[0006] The first target position to which the focus motor moves may refer to the target position X shown in FIG. 5 or the target position X′ shown in FIG. 6 .

[0007] The camera cover moves to a first position. The first position can refer to position Y2 shown in FIG. 5 , position Y1 shown in FIG. 6 , or position Y3 ′ shown in FIG. 7 . The target position of the camera cover can refer to target position Y shown in FIG. 5 to FIG. 7 .

[0008] The first distance can ensure that the camera module and the camera cover do not collide.

[0009] The fact that the first position is smaller than the target position of the camera cover indicates 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 may be the position of the camera cover when the camera application is not open. The initial position of the camera cover can refer to the battery cover positions shown in Figures 5 to 7 of this application.

[0010] As can be seen, the electronic device can move the focus motor based on the position of the camera cover. Before the camera cover moves to its target position, if the camera cover is moved to a position that prevents the focus motor from colliding with the camera module and the camera cover after it moves to the first target position, the electronic device can quickly move the focus motor to the first target position to achieve focus. This eliminates the need for the electronic device to wait for the camera cover to reach its target position before moving the focus motor. This method not only achieves rapid focus after the application is launched, but also reduces collisions between the camera module and the camera cover.

[0011] 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 focus 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.

[0012] The second position may refer to position Y1 shown in FIG. 5 or FIG. 7 of the present application, or FIG. The third position may refer to position X1 shown in FIG. 5 or FIG. 7 of the present application.

[0013] It can be seen that in the process of the camera cover moving to the target position of the camera cover, the electronic device can move the focus motor multiple times according to the position of the camera cover movement at different times. If the position of the camera cover movement will cause the camera module and the camera cover to collide after the focus motor moves to the first target position, the electronic device can first move the focus motor to a safe position corresponding to the current position of the camera cover. This safe position can prevent the camera module and the camera cover from colliding after the focus motor moves to the first target position. The above embodiment can gradually move the focus motor to the target position of the focus motor on the basis of reducing the collision between the camera cover and the focus motor. This can not only reduce the collision between the camera cover and the focus motor, but also improve the focusing efficiency after the camera application is turned on.

[0014] In combination with the first aspect, in some embodiments, before the camera cover moves to the first position, the electronic device continues to move the camera cover while the focus motor moves to the third position; 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 focus 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.

[0015] The fourth position may refer to position Y2' shown in FIG7 of the present application. The fifth position may refer to position X2 shown in FIG7 of the present application.

[0016] As can be seen from the above embodiment, 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. The distance between the fourth position and the third position is less than the first distance. Therefore, movement of the camera cover from the second position to the fourth position can indicate that the camera cover is retracting, i.e., moving in a direction opposite to the target position of the camera cover. This direction opposite to the target position of the camera cover is the direction of the focus motor.

[0017] As can be seen, during the movement of the camera cover, the electronic device can detect whether the camera cover is moving in the direction of the focus motor. If the electronic device detects that the camera cover is moving in the direction of the focus motor, it can adjust the position of the focus motor, moving it away from the camera cover to reduce the possibility of collision between the focus motor and the camera cover.

[0018] In combination with the first aspect, in some embodiments, after the camera cover moves to the fourth position, the electronic device displays a first prompt message, where the first prompt message is used to prompt the user that there is an abnormality in the movement of the camera cover.

[0019] The camera cover may move toward the focus motor due to the user accidentally touching the camera cover. The above prompt message notifying the user of the abnormal camera cover movement can reduce the situation where the camera cover collides with the focus motor due to the user accidentally touching the camera cover.

[0020] In combination with the first aspect, in some embodiments, before the camera cover moves to the first position, the electronic device continues to move the camera cover while the focus motor moves to the third position; 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 focus 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.

[0021] In combination with the first aspect, in some embodiments, before the camera cover moves to the sixth position, when the focus motor moves to the third position, the electronic device pauses moving the focus motor.

[0022] As can be seen, before the focus motor moves to its target position, the electronic device can repeatedly move the focus motor based on the position of the camera cover to positions where the camera module will not collide with the camera cover. Furthermore, after the focus motor reaches the position where the camera module will not collide with the camera cover, it can pause and wait for the next detection of the camera cover's position to determine the next movement. This can better prevent the camera module from colliding with the camera cover when the camera application is opened for focusing.

[0023] In combination with the first aspect, in some embodiments, after the electronic device opens a 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 at the same time.

[0024] In conjunction with the first aspect, in some embodiments, after the camera cover moves to the first position, the electronic device continues to move the camera cover until it reaches the target camera cover position. It can be seen that the movement of the camera cover can be independent of the camera module. When the camera application is opened, the camera cover can move to the target camera cover position according to a preset speed and trajectory, and remain at the target camera cover position until the camera application is closed.

[0025] In combination with the first aspect, in some embodiments, after moving the camera cover to the target position of the camera cover, the electronic device maintains the camera cover at the target position of the camera cover; when the target position of the focus motor changes from the first target position to the third target position, the electronic device moves the focus motor to the third target position.

[0026] As can be seen, the target position of the camera cover is the maximum position to which the camera cover can move. When the camera cover is in the target position, it will not collide with the camera module. After the camera cover reaches the target position, the electronic device can stop detecting the position of the camera cover and directly move the focus motor to the corresponding target position. This embodiment can save power consumption in the electronic device.

[0027] In conjunction with the first aspect, in some embodiments, the first distance is a safe 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 do not collide.

[0028] In a second aspect, the present application provides an electronic device that may include a camera module, a camera cover, a memory, and a processor. The camera module may be used to capture images. The camera module may include a lens and a focus motor. The focus motor may be used to move the lens to achieve focus. The camera cover may be used to provide space for the camera module to move and protect the internal structure of the electronic device. The memory may be used to store a computer program. The processor may be used to invoke the computer program, causing the electronic device to execute any possible implementation method as described in the first aspect.

[0029] In a third aspect, the present application provides a computer-readable storage medium comprising instructions, which, when executed on an electronic device, enables the electronic device to execute any possible implementation method in the first aspect.

[0030] In a fourth aspect, the present application provides a computer program product, which may include computer instructions. When the computer instructions are run on an electronic device, the electronic device executes any possible implementation method as in the first aspect.

[0031] In a fifth aspect, the present application provides a chip, which is applied to an electronic device. The chip includes one or more processors, and the processor is used to call computer instructions to enable the electronic device to execute any possible implementation method as in the first aspect.

[0032] It is understandable that the electronic device provided in the second aspect, 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 methods provided in the embodiments of the present application. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects of the corresponding methods and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] FIG1 is a schematic diagram of a lens imaging method provided in an embodiment of the present application;

[0034] 2A and 2B are schematic diagrams of a camera module provided in an embodiment of the present application;

[0035] FIG3 is a schematic structural diagram of an electronic device 100 provided in an embodiment of the present application;

[0036] FIG4 is a software structure block diagram of an electronic device 100 provided in an embodiment of the present application;

[0037] 5 to 7 are schematic diagrams of some focusing scenarios provided by embodiments of the present application;

[0038] FIG8 is a flowchart of a focusing method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0039] The technical solutions in the embodiments of the present application are described below in conjunction with the 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 be used as limitations on the present application. As used in the specification and claims of the present application, the singular expressions "a", "said", "above", "the" and "this" are intended to also include expressions such as "one or more", unless there is a clear contrary indication in the context. It should also be understood that in the following embodiments of the present application, "at least one", "one or more" refer to one or more (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 represent: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.

[0040] References to "one embodiment" or "some embodiments" etc. described in this specification mean that the specific features, structures or characteristics described in conjunction with the embodiment are included in one or more embodiments of the present application. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. appearing in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in another way. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in another way. The term "connected" includes direct and indirect connections, unless otherwise stated. "First" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated.

[0041] In the embodiments of this application, words such as "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of this application should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplarily" or "for example" is intended to present the relevant concepts in a concrete manner.

[0042] To facilitate understanding, some concepts of camera focus are introduced here.

[0043] 1. Object distance

[0044] The object distance may refer to the distance from the object being photographed to the lens used for photographing.

[0045] 2. Image distance

[0046] Image distance can refer to the distance from the imaging plane to the lens used for shooting. The imaging plane can be called the image plane or other names.

[0047] 3. Focus

[0048] The focal point is the point on the optical axis where light rays passing through the lens and parallel to the optical axis converge. The optical axis can also be called the principal optical axis.

[0049] 4. Focal length

[0050] Focal length refers to the distance between the center of the lens and the focal point. The longer the focal length, the farther away the camera can capture objects. In some embodiments, the focal length of the camera is adjustable. The electronic device can adjust the camera's focal length through physical or electronic zoom.

[0051] The relationship between object distance, image distance, and focal length can be expressed by the Gaussian imaging formula:

[0052] Where u represents the object distance, v represents the image distance, and f represents the focal length. When the object distance, image distance, and focal length satisfy the Gaussian imaging formula, the electronic device can focus on the object at the corresponding position of the object distance, resulting in a clear image of the object on the imaging plane.

[0053] FIG1 exemplarily shows a schematic diagram of lens imaging.

[0054] As shown in Figure 1, the lens can be used to receive light signals and converge the light signals on the photosensor. The photosensor can be used to convert light signals into electrical signals to achieve imaging of the photographed object. For example, the photosensor may include a charge-coupled device (CCD). The plane where the photosensor is located can be called an image plane. Object A can be the object to be photographed. Object A can be imaged as object A' on the photosensor through the lens. The distance from object A to the lens is the object distance. When the object distance changes, in order to make the image of object A clear on the photosensor, the electronic device needs to adjust the image distance and / or focal length.

[0055] For example, when object A moves away from the lens and the object distance increases, while the focal length remains 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 away from the lens and the object distance decreases, while the focal length remains unchanged, the electronic device needs to move the lens to increase the image distance in order to focus on object A.

[0056] 2A and 2B exemplarily show schematic diagrams of a camera module.

[0057] As shown in Figure 2A, the camera module may include a lens, a focus motor, and a light sensor. The lens may be a lens assembly consisting of multiple lenses. In some embodiments, the focal length of the lens assembly can be changed by adjusting the relative positions of the multiple lenses. When the focal length is fixed, the focus motor can drive all the lenses in the camera module to move as a whole to adjust the image distance and achieve focus. The camera module can be built into the electronic device and located between the battery cover and the mainboard of the electronic device. The camera module can be snapped onto the mainboard. The camera module can also be called a camera module.

[0058] The battery cover of an electronic device can also be called a back shell or back cover, which can be used to protect the internal structure of the electronic device.

[0059] The motherboard of an electronic device may include hardware modules such as a central processing unit (CPU) and an image signal processor (ISP). The motherboard can be used to provide power and computing resources to devices attached to it (for example, cameras and camera covers), and to control the behavior of these devices.

[0060] In some embodiments, the focus motor can push the lens to move in the space between the battery cover and the main board. This can change the image distance and achieve focusing on objects at different distances. The maximum travel of the focus motor is limited by the distance between the battery cover and the main board. In the case of a thin electronic device, the distance between the battery cover and the main board is short, and the focus motor cannot push the lens to a position far away from the photosensor. Therefore, the image distance of the camera module is relatively small. It can be seen from the above Gaussian imaging formula that the camera module cannot focus on objects at a closer position. The focusing effect of the camera module is poor, which affects the user's shooting experience. If the movement stroke of the focus motor needs to be increased, 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 thickness of the electronic device is relatively large and the camera module is very prominent.

[0061] As shown in Figure 2B, the electronic device may further include a camera cover. The camera cover may be connected to the battery cover to protect the internal structure of the electronic device. The camera cover may be a lifting device. The camera cover may be positioned corresponding to the camera module. When the camera application is activated, the electronic device may move the camera cover toward the outside of the battery cover, thereby providing more space for the camera module. This allows the focus motor to push the lens to move within the space between the camera cover and the motherboard. Since the camera cover can rise to a position outside the battery cover, the focus motor can also push the lens to move outside the battery cover. Furthermore, after rising to a position outside the battery cover, the camera cover can protect the camera module while it is in operation. For example, the camera cover can protect the camera module and reduce the risk of damage to the camera module from collisions. Furthermore, the camera cover is also waterproof and dustproof. Light signals can be received by the lens through the camera cover and then converged by the lens to the photosensor.

[0062] When the camera application is closed, the focus motor can push the lens back to its initial position, and the camera cover also returns to its initial position. The initial position of the camera cover can be parallel to the battery cover or slightly higher than the battery cover. In this way, when the camera application is not in use, the electronic device can be in a state of reduced thickness. The above-mentioned focus motor and camera cover can move independently. The embodiments of the present application do not limit the initial position of the above-mentioned focus motor and the initial position of the camera cover.

[0063] As can be seen, the aforementioned camera cover allows the focus motor to push the lens to a further position. The focus motor's travel range is no longer limited by the thickness of the electronic device. This increases the camera module's focus range, allowing it to focus not only on distant objects but also on objects closer.

[0064] The camera cover may also be called a sports lens, a camera protective cover, or the like.

[0065] In some embodiments, the photosensor in the camera module is relatively large. The larger the photosensor, the larger the photosensitive area, the more light it captures, and the richer the information recorded in the photo. A large photosensor can provide better color accuracy, low-light performance, and noise control. A camera module with a large photosensor can be called a large-bottom camera module or a large-bottom module. Although large-bottom camera modules have higher image quality, they require more space. In order to fully utilize the large sensor for imaging, the focus motor also needs to have a longer travel range.

[0066] The electronic device with a camera cover shown in FIG2B can meet the imaging requirements of a large-bottom camera module.

[0067] When the camera application is activated on the electronic device with the camera cover, the electronic device needs to move both the camera cover and the focus motor to their respective target positions. The target position of the camera cover can be the maximum position to which the camera cover can be extended or retracted. The target position of the focus motor can be preset or determined based on the initial image captured by the camera module. The focus motor typically moves faster than the camera cover.

[0068] In some embodiments, to avoid audible collisions between the camera cover and the focus motor during movement, the electronic device can first move the camera cover to its target position before moving the focus motor to its target position. However, moving both the camera cover and the focus motor to their respective target positions takes time. This can cause the camera module to focus slowly. The first few frames displayed after the electronic device opens the camera application may appear blurry because the focus motor has not yet reached its target position.

[0069] Alternatively, to increase focusing speed, the electronic device may begin moving the focus motor before the camera cover reaches its target position. Because the focus motor moves faster than the camera cover, it could cause the lens to collide with the camera cover, producing unusual noise. This could damage the camera module and affect the user experience with the camera app.

[0070] The present invention provides a focusing method that dynamically adjusts the movement trajectory of a focus motor based on the movement of a camera cover, balancing the relative positions of the camera cover and the focus motor, enabling rapid focus after the camera application is launched and reducing collisions between the focus motor and the camera cover. Collision between the focus motor and the camera cover can refer to collisions between the lens pushed by the focus motor and the camera cover, or collisions between the camera module and the camera cover.

[0071] When a camera application is activated, the electronic device can determine the target position of the focus motor and begin moving the camera cover in the direction of the target position. The electronic device can periodically detect the position of the camera cover. A distance, such as a first distance, can be maintained between the focus motor and the camera cover to prevent the focus motor from colliding with the camera module during movement. For example, upon detecting that the camera cover has moved to position Y1, the electronic device can determine whether the distance between the focus motor's target position and position Y1 is less than a first distance. A distance between the focus motor and the camera cover that is greater than or equal to the first distance ensures that the focus motor pushes the lens without colliding with the camera cover. If the distance between the focus motor's target position and position Y1 is greater than or equal to the first distance, the electronic device can move the focus motor to the target position, thereby completing focus. If the distance between the focus motor's target position and position Y1 is less than the first distance, the electronic device can move the focus motor to a safe position corresponding to position Y1 and continue moving the camera cover. The distance between position Y1 and the safe position corresponding to position Y1 is greater than or equal to the first distance. The electronic device can detect the position of the camera cover again after a period of time, and then move the focus motor based on the relationship between the position of the camera cover and the target position of the focus motor. The electronic device can detect the position of the camera cover multiple times to adjust the position of the focus motor so that the focus motor moves to the target position of the focus motor.

[0072] The first distance can represent a safe distance between the focus motor and the camera cover. When the focus motor and the camera cover maintain this safe distance, the focus motor and the camera cover can be prevented from colliding. The embodiment of the present application does not limit the value of the first distance.

[0073] It can be seen that the electronic device can move the focus motor while moving the camera cover. The electronic device can detect the position of the camera cover multiple times, thereby moving the focus motor multiple times to prevent the focus motor from colliding with the camera cover. Once it is detected that the safety position corresponding to the position of the camera cover exceeds the target position of the focus motor, the electronic device can quickly move the focus motor to the target position of the focus motor to complete the focus. In other words, the electronic device does not need to wait until the camera cover moves to the target position of the camera cover before starting to move the focus motor. This can not only improve the focusing speed of the electronic device after turning on the camera application, but also reduce the collision between the focus motor and the camera cover during the focusing process.

[0074] The structure of the electronic device 100 involved in this application is introduced below.

[0075] FIG3 exemplarily shows a structural diagram of the electronic device 100 provided in this application.

[0076] As shown in Figure 3, 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, an earphone 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 should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. 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). The different processing units may be independent devices or integrated into one or more processors.

[0079] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0080] Processor 110 may also include a memory for storing instructions and data. In some examples, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the instruction or data again, it can directly retrieve it from the memory. This avoids repeated accesses, reduces processor 110 latency, and thus improves system efficiency.

[0081] In the present application, a computer program may be stored in the memory, configured to cause a controller or processor to implement the focusing method of the present application via an interface or protocol. For example, the computer program stored in the memory may be used to: determine the target position of the focus motor, control the movement of the camera cover and the focus motor, detect the positions of the camera cover and the focus motor in real time, determine the relationship between the target position of the focus motor and the safe position corresponding to the position of the camera cover, process and display the captured image, and so on.

[0082] The USB interface 130 is an interface that complies with the USB standard. The USB interface 130 can be used to connect a charger to charge the electronic device 100, or to transfer data between the electronic device 100 and peripheral devices. The USB interface 130 can also be used to connect headphones to play audio through the headphones.

[0083] The charging management module 140 is used to receive charging input from a charger. The charger can be a wireless charger or a wired charger. While charging the battery 142, the charging management module 140 can also power 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 input from the battery 142 and / or the charging management module 140 to provide power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, and the wireless communication module 160.

[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 modem processor and the baseband processor.

[0086] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.

[0087] The mobile communication module 150 can provide wireless communication solutions, including 2G / 3G / 4G / 5G, for the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low-noise amplifier (LNA), and the like. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modem processor for demodulation. The mobile communication module 150 can also amplify the signals modulated by the modem processor and convert them into electromagnetic waves for radiation via the antenna 1.

[0088] The wireless communication module 160 can provide wireless communication solutions 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 (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0089] The electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing that connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations 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 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.

[0092] The ISP is used to process data fed back by the camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then transmitted to the ISP for processing and converted into an image visible to the naked eye.

[0093] The camera 193 is used to capture still images or videos. The 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 passes the electrical signal to the ISP for conversion 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 RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0094] The camera 193 may be the camera module shown in FIG. 2A and FIG. 2B .

[0095] In some embodiments, the electronic device 100 further includes the camera cover shown in FIG. 2B .

[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 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0097] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU can enable intelligent cognitive applications in electronic device 100, such as image recognition, face recognition, speech recognition, and text comprehension.

[0098] The external memory interface 120 can be used to connect 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 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.

[0099] The internal memory 121 can be used to store computer executable program codes, which include 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 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), 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.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may 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 such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0101] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some examples, the audio module 170 can be set in the processor 110, or some functional modules of the audio module 170 can be set in the processor 110. The speaker 170A, also known as the "speaker", is used to convert audio electrical signals into sound signals. The receiver 170B, also known as the "earpiece", is used to convert audio electrical signals into sound signals. The microphone 170C, also known as the "microphone" or "microphone", is used to convert sound signals into electrical signals. The headphone jack 170D is used to connect wired headphones.

[0102] The sensor module 180 may include a pressure sensor, a gyro sensor, an air 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, and the like.

[0103] Buttons 190 include a power button, a volume button, etc. Motor 191 can generate vibration prompts. Indicator 192 can be an indicator light that can be used to indicate charging status, power changes, messages, missed calls, notifications, etc.

[0104] The SIM card interface 195 is used to connect a SIM card. A SIM card can be connected to and disconnected from the electronic device 100 by inserting or removing it from the SIM card interface 195. The electronic device 100 may 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 implement functions such as calls and data communications. In some examples, the electronic device 100 uses an eSIM, or 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 micro-kernel architecture, a micro-service architecture, or a cloud architecture. Taking the system as an example, the software structure of the electronic device 100 is exemplarily described.

[0106] FIG4 exemplarily shows a software structure block diagram of the electronic device 100 provided in this application.

[0107] The layered architecture divides the software into several layers, each with 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: application layer, application framework layer, Android runtime (Android Runtime) and system library, and kernel layer.

[0108] The application layer can include a series of application packages.

[0109] As shown in FIG4 , the application package 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 applications in the application layer. The application framework layer includes some predefined functions.

[0111] As shown in FIG4 , 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 camera cover and focus motor joint decision module, and the like.

[0112] The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, take screenshots, etc.

[0113] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0114] The view system includes visual controls, such as those for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a display interface containing a text notification icon might include a view for displaying text and a view for displaying images.

[0115] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including answering, hanging up, etc.).

[0116] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0117] The Notification Manager allows 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 and can disappear automatically after a short stay without user interaction. For example, the Notification Manager is used to notify the completion of downloads, message reminders, etc. The Notification Manager can also be used to display notifications in the form of icons or scrolling text in the status bar at the top of the system, such as notifications from applications running in the background, or notifications that appear on the screen in the form of dialog windows. For example, text messages can be displayed in the status bar, prompts can be sounded, electronic devices can vibrate, indicator lights can flash, etc.

[0118] The Activity Manager is responsible for managing activities, starting, switching, and scheduling components in the system, as well as managing and scheduling applications. The Activity Manager can be called by upper-level applications to open corresponding activities.

[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 signal generated by the photosensitive sensor in the camera module and generate an image based on the above electrical signal. In some embodiments, the camera image output module can perform one or more processing such as cropping, noise optimization, brightness optimization, and filter adjustment on the image. Specifically, when the focus motor in the camera module moves to the target position of the focus motor, the camera image output module can generate a clear image of the focused object. The camera image output module can send the generated image to the camera application, which is displayed in real time on the shooting interface by the camera application.

[0120] The camera cover and focus motor joint decision module can be used to make decisions on the movement of the camera cover and the focus motor 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 module can obtain the position of the camera cover movement at regular intervals, and decide how to move the focus motor based on the position of the camera cover. If the target position of the focus motor is smaller than the safety position corresponding to the position of the camera cover, the camera cover and focus motor decision 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 larger than the safety position corresponding to the position of the camera cover, the camera cover and focus motor decision module can instruct the focus motor to move to the safety position corresponding to the position of the camera cover, and wait for the camera cover to move for a period of time before continuing to move the focus motor. In this way, the focus motor can be quickly moved to the target position of the focus motor while reducing the collision between the focus motor and the camera cover, thereby improving the focusing speed.

[0121] Android Runtime includes core libraries and a virtual machine. Android Runtime is responsible for scheduling and management of the Android system.

[0122] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.

[0123] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.

[0124] The system library can include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0125] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.

[0126] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding 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, compositing, and layer processing.

[0128] A 2D graphics engine is a drawing engine for 2D drawings.

[0129] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, and sensor driver.

[0130] 5 to 7 exemplarily show some schematic diagrams of focusing scenes.

[0131] As shown in FIG5 , when the camera application is not open, the focus motor and the camera cover are both in their initial positions. For example, the initial position of the camera cover may be the position of the battery cover. In some embodiments, when the focus motor and the camera cover are both in their initial positions, the camera cover and the focus motor do not protrude or protrude only slightly from the back of the electronic device 100.

[0132] At time t1, the electronic device 100 opens the camera application. The electronic device 100 may open the camera application in response to an operation on the camera application icon. Alternatively, the electronic device 100 may open the camera application in response to a request from another application to call the camera application. For example, an application such as a QR code payment application or a video call application may request to call the camera application to implement a corresponding function. The present embodiment of the application does not limit the triggering conditions for the electronic device 100 to open the camera application.

[0133] When the camera application is turned on, the electronic device 100 can determine the target position X for the focus motor to move. In some embodiments, the electronic device 100 may preset the initial target position of the focus motor after the camera application is turned on. The electronic device 100 can use the initial target position as the target position X. In some embodiments, the electronic device 100 can identify the first frame image or the previous multiple frames of images captured after the camera application is turned on, and use the first frame image or the previous multiple frames of images to determine the target position X. The embodiment of the present application does 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 for the camera cover to be moved. The target position Y for the camera cover to be moved can be preset, which 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 closed. This can provide the focus motor with sufficient moving space during the shooting process, thereby improving the focusing effect of the electronic device 100. Due to the structural design of the camera cover itself and taking into account factors such as noise during the movement of the camera cover, the movement speed of the camera cover is slow. In some embodiments, the camera cover can move to the target position Y at a preset speed. Optionally, the movement speed of the camera cover can remain unchanged.

[0135] When the camera application is turned on, the electronic device 100 can detect the position of the camera cover movement at regular intervals. The electronic device 100 can detect the position of the camera cover movement regularly or irregularly. That is, the time period between two adjacent detections of the camera cover movement by the electronic device 100 can be a fixed time length, or it can be a non-fixed time length. For example, the electronic device 100 can detect the position of the camera cover movement once every preset time length. The above-mentioned preset time length can be a value of 15 milliseconds (ms), 30ms, 40ms, etc. The embodiment of the present application does not limit the value of the above-mentioned preset time length.

[0136] In some embodiments, when the camera application is turned on, in addition to moving the camera cover, the electronic device 100 may also start moving the focus motor. In particular, 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 focus motor moves at a relatively fast speed. The focus motor moves at a speed generally faster than the camera cover. The time when the focus motor starts moving may be later than the time when the camera cover starts moving. For example, when the camera application is turned on, the electronic device 100 may start moving the camera cover. After the camera cover moves for 10ms, the electronic device 100 may start moving the focus motor. The embodiment of the present application does not limit the length of time that the camera cover moves earlier than the focus motor. Since the focus motor moves faster than the camera cover, starting the camera cover to move a short time before the focus motor can better avoid collision between the camera cover and the focus motor.

[0137] Alternatively, when the camera application is turned on, the camera cover and the focus motor can start moving at the same time. Specifically, when the distance between the focus motor and the camera cover is greater than the first distance, there will be no collision between the focus motor and the camera cover. That is, the above-mentioned first distance can be a distance that prevents the camera module and the camera cover from colliding. The above-mentioned first distance may depend on the structural design of the camera cover, lens and focus motor. The embodiment of the present application does not limit the size of the above-mentioned first distance. When the camera application is not yet turned on, 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 at the same time for a period of time after turning on the camera application, there will usually be no situation where the focus motor collides with the camera cover. Starting the focus motor and the camera cover to move at the same time can better shorten the time for the focus motor to move to the target position of the focus motor and improve focusing efficiency.

[0138] Alternatively, during the period from when the camera application is turned on to when the camera cover movement position is detected for the first time, the electronic device 100 may only move the camera cover while keeping the focus motor at the initial position.

[0139] In some embodiments, the electronic device 100 is not limited to determining the target position of the focus motor. After the camera application is turned on, the electronic device 100 can determine the target position of other components in the camera module that need to be moved when focusing. Then, the electronic device 100 can control the movement of the focus motor according to the movement of the camera cover, so that the other components in the camera module reach the corresponding target positions. For example, the electronic device 100 can determine the target position of the lens after the camera application is turned on. The electronic device 100 can control the movement of the focus motor according to the movement of the camera cover, so that the lens moves to the target position of the lens.

[0140] By referring to the first distance between the focus motor and the camera cover, and upon obtaining the target positions of components other than the focus motor, the electronic device 100 can determine the required distance between the components and the camera cover. Thus, when the focus motor is moved to its target position, the electronic device 100 can control the movement of the focus motor based on the required distance between the components and the camera cover to reduce collisions between the camera module and the camera cover. The target position of the focus motor and the first distance are used as examples in the subsequent embodiments of this application.

[0141] As shown in Figure 5, the electronic device 100 can detect the position of the camera cover at time t2. 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 focus motor and the first distance is greater than Y1, that is, determine whether the distance between the target position X and 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 focus motor cannot currently move directly to the target position X, otherwise it may collide with the camera cover. Therefore, if the sum of the target position X and the first distance is greater than Y1, the electronic device 100 can move the focus motor to position X1. Position X1 is the position 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 Y1 minus the first distance.

[0142] In some embodiments, the camera cover moving to position Y1 may mean that the top of the camera cover moves to position Y1 (see FIG5 ). The camera cover is a lifting device, and the top of the camera cover is also 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 may also mean that any part of the camera cover moves to position Y1. In the present application, the reference part used when the camera cover moves to different positions at different times may be the same. That is, the camera cover moving to different positions at different times may mean that a part of the camera cover moves to these different positions at different times.

[0143] The time t2 may be the first time the electronic device 100 detects the movement of the camera cover after the camera application is turned on. Between the first and second detections, the electronic device 100 may move the focus motor to the safe position corresponding to the position Y1 (i.e., position X1) and continue to move the camera cover.

[0144] As shown in Figure 5, the electronic device 100 can detect the position of the camera cover movement 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 focus motor has moved to position X1. In some embodiments, the focus motor can move to position X1 during the time period from time t2 to time t3 when the camera cover is moved. When it moves to position X1, the focus motor can stop moving and wait to determine how the focus motor will move next when the position of the camera cover movement is detected next. For example, if the focus motor moves to position X1 at a moment between time t2 and time t3, the focus motor can temporarily stop moving after reaching position X1. The electronic device 100 can determine how the focus motor will move based on the position of the camera cover movement at time t3.

[0145] In some embodiments, the focus motor has a certain thickness. The focus motor moving to position X1 may indicate that the top of the focus motor moves to position X1, or may indicate that the bottom of the focus motor moves to position X1. This embodiment of the present application is not limited to this. That is, the focus motor moving to position X1 may indicate that any part of the focus motor moves to position X1. In the present application, the reference part used when the focus motor moves to different positions at different times may be the same. That is, the focus motor moving to different positions at different times may indicate that a part of the focus motor moves to these different positions at different times.

[0146] Electronic device 100 can determine whether the sum of the target position X of the focus motor and the first distance is greater than Y2, that is, whether the distance between target position X and position Y1 is greater than the first distance. If the sum of target position X and the first distance is less than or equal to Y2, the focus motor can currently move directly to target position X without colliding with the camera cover. Therefore, if the sum of target position X and the first distance is less than or equal to Y2, electronic device 100 can move the focus motor toward target position X.

[0147] If the position Y2 is smaller than the target position Y, the camera cover can continue to move after moving to the position Y2 at time t3.

[0148] As shown in FIG5 , electronic device 100 can detect the position of the camera cover movement for the third time at time t4. At time t4, the camera cover has moved to position Y3, the focus motor has moved to target position X, and the sum of target position X and the first distance is less than Y3. After moving to target position X, the focus motor can remain stationary. If the camera cover has not moved to target position Y at time t4, the camera cover can continue to move toward target position Y until it reaches target position Y.

[0149] It should be noted that the duration of the time period between time t1 and time t2 and the duration of the time period between time t2 and time t3 may be the same, or may be different.

[0150] In some embodiments, while the focus motor is moving toward the safe position corresponding to the position of the camera cover during the last detection, the camera cover continues to move. When the focus motor moves to the safe position corresponding to the position of the camera cover during the last detection, the electronic device 100 can detect the most recently moved position of the camera cover and adjust the position of the focus motor based on the most recently moved position. In other words, the moment when the electronic device 100 detects the position of the camera cover can include the moment when the focus motor moves to the safe position corresponding to the position of the camera cover during the last detection. For example, in Figure 5 above, the above-mentioned time t3 can be the moment when the focus motor moves to position X1. This can reduce the time the focus motor waits for the next detection after moving to the target position X one or more times to the safe position corresponding to the position of the camera cover. The above embodiment can improve focusing efficiency and enable the focus motor to move to the target position X more quickly while reducing collisions between the focus motor and the camera cover.

[0151] As shown in Figure 6, after the electronic device 100 starts the camera application at time t1, it can determine that the target position for the focus motor to move is position X'. At time t2, the electronic device 100 can detect that the camera cover has moved to position Y1. 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 focus motor toward the target position X'. In addition, the electronic device 100 can continue to move the camera cover.

[0152] As shown in Figure 6, at time t3, the camera cover has moved to position Y2, and the focus motor has moved to target position X'. The sum of target position X' and the first distance is less than Y2. If position Y2 is less than the target position Y for the camera cover, the camera cover may continue to move. For example, after time t3, the camera cover may continue to move toward target position Y and move to position Y3 at time t4. If the target position of the focus motor remains unchanged, the focus motor may remain at target position X'.

[0153] As can be seen from Figures 5 and 6 above, the electronic device 100 can detect the position of the camera cover multiple times. During these multiple detections of the camera cover position, if the distance between the camera cover position and the focus motor's target position is detected to be less than a first distance, the electronic device 100 can move the focus motor to a safe position corresponding to the position of the camera cover during that detection and continue subsequent detections. If the distance between the camera cover position and the focus motor's target position is detected to be greater than or equal to the first distance, the electronic device 100 can move the focus motor to the focus motor's target position to complete focusing.

[0154] In some embodiments, the camera cover may move toward the direction of the focus motor and then retreat during movement. For example, when the camera cover is subjected to an external force, it may be pushed toward the direction of the focus motor, or it may be stuck before reaching the target position of the camera cover and cannot continue to move toward the target position of the camera cover. Alternatively, the electronic device 100 may malfunction, causing the camera cover to retreat instead of move forward, toward the direction of the focus motor. The camera cover moves toward the direction of the focus motor, and the focus motor moves toward the target position of the focus motor. This will cause the camera cover and the focus motor to move relative to each other, and the camera cover may collide with the focus motor, preventing the focus motor from moving to the target position of the focus motor. The electronic device 100 can move the focus motor away from the camera cover when the focus motor collides with the camera cover based on the relative positional relationship between the camera cover and the focus motor to reduce the collision between the two.

[0155] Here, the target position of the focus motor is still taken as position X, and the target position of the camera cover is taken as position Y as an example for description.

[0156] As shown in Figure 7, the electronic device 100 turns on the camera application at time t1, determines the target position X for the focus motor to move, 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 focus motor to position X1. Position X1 is the position of 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 of Y1 minus the first distance. For the specific status of the camera cover and focus motor at times t1 and t2, please refer to the introduction of the embodiment of Figure 5 above.

[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 moved in the direction of the focus motor during the time period between time t2 and time t3. Meanwhile, the focus motor moved in the direction of the camera cover during the time period between time t2 and time t3 and needed to move to position X1. Because the camera cover and the focus motor move relative to each other, the focus motor may have collided with the camera cover before moving to position X1, or the focus motor may have already moved to position X1 and collided with the camera cover as it retreated.

[0158] Electronic device 100 can determine position X2 based on position Y2'. X2 is the position Y2' minus the first distance. That is, position X2 is the safe position corresponding to position Y2'. Electronic device 100 can move the focus motor toward position X2. Optionally, the distance between the safe position corresponding to position Y2' and position Y2' can be greater than the first distance. That is, position X2 can be farther from position Y2' than the position Y2' minus the first distance.

[0159] As shown in Figure 7, 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'. If 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 focus motor toward the target position X. In addition, if the camera cover has not yet moved to the target position Y, the electronic device 100 can continue to move the camera cover toward the target position Y.

[0160] At time t5, electronic device 100 detects the position of the camera cover for the fourth time. At time t5, the camera cover has moved to position Y4, and the focus motor has moved to target position X. The sum of target position X and the first distance is less than Y4. Thus, the camera application has completed its first focus after being turned on.

[0161] As shown in FIG. 7 , electronic device 100 can detect whether the camera cover is moving toward the focus motor during its movement. Upon detecting that the camera cover is moving toward the focus motor, electronic device 100 can adjust the position of the focus motor, moving it away from the camera cover to reduce collisions between the focus motor and the camera cover.

[0162] In some embodiments, when the camera application is turned on and the camera cover is moved in the direction of the focus motor, the electronic device 100 may display a prompt message on the screen to remind the user that the camera cover movement is abnormal. 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 reminding the user that the camera cover movement is abnormal 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 prompting the user to check whether the camera cover is blocked or stuck by an obstacle, content prompting the user to restart the camera application, etc.

[0163] In some embodiments, the target position of the focus motor can be changed as the object distance of the focus object changes. In addition, in response to the user operation of switching the focus object, the electronic device 100 can also update the target position of the focus motor according to the object distance of the focus object after switching. 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 move the focus motor to the updated target position based on 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 FIG5 , the electronic device 100 moves the focus motor to 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. The event may be triggered by a change in the position of the focus object causing a change in the object distance, or may be triggered by a user operation for switching the focus object. The embodiment of the present application does not limit the triggering conditions of the above-mentioned 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] When the target position of the focus motor is updated to 2X, at time t3 shown in FIG5 , 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 can be the position of Y2 minus the first distance.

[0167] Furthermore, at time t4 shown in FIG. 5 , the electronic device 100 detects that the camera cover has moved to 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 focus motor toward 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 focus motor to a safe position corresponding to position Y3, and subsequently continue to detect the position of the camera cover, and then move the focus motor according to the position of the camera cover, thereby quickly moving the focus motor to the target position 2X of the focus motor while reducing collisions between the focus motor and the camera cover.

[0168] For another example, the position of the focus motor is updated from position X to X / 2.

[0169] After the electronic device 100 shown in FIG. 5 detects that the camera cover has moved to position Y1 at time t2, the electronic device 100 may move the focus motor to the safety position X1 corresponding to position Y1. If, between time t2 and time t3, the electronic device 100 determines that the target position of the focus motor has been updated to X / 2, the electronic device 100 may determine whether the sum of the target position X / 2 and the first distance is less than or equal to 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 may adjust the position of the focus motor to move it toward the updated target position X / 2. In this way, at time t3 shown in FIG. 5, the focus motor may have already moved to target position X / 2 or may be about to move to target position X / 2. The electronic device 100 no longer needs to compare the position Y2 at which the camera cover was moved at time t3 with the target position of the focus motor.

[0170] Alternatively, if the focus motor's target position is updated to X / 2 between time t2 and time t3, the electronic device 100 may continue to move the focus motor toward the safety position X1 corresponding to position Y1. After the electronic device 100 detects that the camera cover has moved to position Y2 at time t3, it may determine whether the sum of the focus motor's updated target position X / 2 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 may move the focus motor from position X1 to the target position X / 2.

[0171] That is, when the target position update of the focus motor is detected, the electronic device 100 can immediately adjust the position of the focus motor based on the relative positional relationship between the most recently detected camera cover position and the updated target position of the focus motor. Alternatively, the electronic device 100 can adjust the position of the focus motor based on the relative positional relationship between the camera cover position and the updated target position of the focus motor the next time the camera cover position is detected.

[0172] FIG8 exemplarily shows a flow chart of a focusing method provided by the present application.

[0173] As shown in FIG. 8 , the method may include steps S811 to S821 .

[0174] S811. Start the camera application.

[0175] S812: Determine the target position X for the focus motor to move, and move the camera cover.

[0176] For steps S811 and S812 , reference may be made to the introduction of the electronic device 100 starting the camera application at time t1 as shown in FIG. 5 .

[0177] S813: Detect that the camera cover moves to position Y1.

[0178] S814: Determine whether the distance between X and Y1 is less than the first distance.

[0179] The distance between the focus motor and the camera cover is greater than or equal to the first distance to prevent the camera cover from colliding with the camera module. The first distance can represent a safe distance between the focus motor and the camera cover.

[0180] After the camera application is activated, the electronic device 100 may periodically detect the position of the camera cover. Upon detecting that the camera cover has moved to position Y1, the electronic device 100 may determine whether the distance between X and Y1 is less than a first distance. If the distance between target position X and Y1 is less than the first distance, this may indicate that moving the focus motor to target position X may cause the camera module to collide with the camera cover. If the distance between target position X and Y1 is greater than or equal to the first distance, this may indicate that moving the focus motor to target position X will not cause the camera module to collide with the camera cover.

[0181] If the distance between X and Y1 is greater than or equal to the first distance, the electronic device 100 may execute step S815.

[0182] If the distance between X and Y1 is less than the first distance, the electronic device 100 may execute step S816.

[0183] S815 , continue to move the camera cover toward the target position Y, and move the focus motor toward the target position X.

[0184] The focus motor may move to the target position X to indicate that the focus is complete. After the focus motor moves to the target position X, the camera cover may continue to move until it reaches the target position Y.

[0185] S816 , continue to move the camera cover toward the target position Y, and move the focus motor toward position X1 , where the distance between X1 and Y1 is greater than or equal to the first distance.

[0186] Because the distance between X1 and Y1 is greater than or equal to the first distance, the focus motor moving to position X1 will not cause the camera module to collide with the camera cover. Position X1 can be determined based on position Y1. Position X1 can also be called a safe position corresponding to position Y1.

[0187] S817: Detect that the camera cover moves to position Y2.

[0188] After detecting that the camera cover has moved to position Y1, the electronic device 100 may wait for a period of time and then detect the position of the camera cover again, and then detect that the camera cover has moved to position Y2. During the period of time when the camera cover moves from position Y1 to position Y2, the focus motor may have moved to position X1, or may not have moved to position X1.

[0189] S818. Determine whether Y1 is less than Y2.

[0190] The electronic device 100 can determine the distance between two consecutive camera cover detections. For example, the electronic device 100 can determine whether Y1 is less than Y2. If Y1 is less than Y2, it may indicate that the camera cover is moving in the direction of the target camera cover position Y, that is, during the process of moving from position Y1 to position Y2, the camera cover has moved to a position further away from the initial camera cover position. If Y1 is greater than Y2, it may indicate that the camera cover is moving in the direction of the focus motor, that is, during the process of moving from position Y1 to position Y2, the camera cover has moved to a position closer to the initial camera cover position.

[0191] If Y1 is less than Y2, the distance between the camera cover and the focus motor increases, and the electronic device 100 can continue to move the focus motor so that the focus motor is closer to the focus motor target position X 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 focus motor is reduced, and the camera cover and the focus motor may even collide. When it is determined that Y1 is greater than Y2, the electronic device 100 may execute step S820.

[0193] If Y1 equals Y2, the camera cover remains at position Y1 and has not moved. Therefore, position X1 is also the safe position corresponding to position Y2. After the focus motor moves to position X1, it can temporarily remain stationary to avoid colliding with the camera cover.

[0194] S819: Determine whether the distance between X and Y2 is less than the first distance.

[0195] If the distance between the target position X and Y2 is less than the first distance, it may indicate that the camera module may collide with the camera cover when the focus motor moves to the target position X. If the distance between the target position X and Y2 is greater than or equal to the first distance, it may indicate that the camera module will not collide with the camera cover when the focus motor moves to the target position X.

[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 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 toward the target position Y, and move the focus motor toward position X2 , where the distance between X2 and Y2 is greater than or equal to the first distance.

[0198] Because the distance between X2 and Y2 is greater than or equal to the first distance, the focus motor moving to position X2 will not cause the camera module to collide with the camera cover. Position X2 can be determined based on position Y2. Position X2 can also be called a safe position corresponding to position Y2.

[0199] When Y1 is greater than Y2, position X2 is closer to the focus motor's initial position than position X1. Therefore, when Y1 is greater than Y2, the focus motor's movement toward position X2 can be in a direction away from the camera cover. This reduces the risk of the focus motor colliding with the retracting camera cover. For details, please refer to the description of the camera cover and focus motor movement from time t2 to time t3 shown in Figure 7 above.

[0200] When Y1 is less than Y2, position X2 is further from the focus motor's initial position than position X1. Therefore, when Y1 is less than Y2, the focus motor's movement toward position X2 can be considered as movement closer to the focus motor's target position. This allows the focus motor to gradually approach the focus motor's target position as the camera cover moves, without colliding with the cover, to achieve focus.

[0201] S821 , detecting the position of the camera cover at regular intervals, and moving the focus motor according to the relationship between the position of the camera cover and the target position X, so that the focus 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. The electronic device 100 may then determine how to move the focus motor based on the relative positional relationship between the most recently detected camera cover position and the last detected camera cover position, as well as the relative positional relationship between the most recently detected camera cover position and the focus motor's target position. For details, please refer to steps S817 to S820 above.

[0203] The above method can gradually move the focus motor to its target position while reducing collisions between the camera cover and the focus motor during camera cover movement. This not only reduces collisions between the camera cover and the focus motor, but also improves focus efficiency after the camera application is activated. Using the above method, electronic device 100 can quickly achieve focus after the camera application is activated, ensuring that the first multiple frames displayed after the camera application is activated are clear images of the focused object.

[0204] In some embodiments, the electronic device 100 may detect the position of the camera cover at regular intervals throughout the entire process in which the camera application is turned on, and compare the relative position relationship between the position of the camera cover and the target position of the focus motor. If the difference 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 a safe position corresponding to the current position of the camera cover, or retract the focus motor to the initial position of the focus motor. This can reduce the collision between the focus motor and the camera cover. If the difference 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 embodiment can reduce the situation in which the camera cover collides with the focus motor due to abnormal movement of the camera cover (i.e., the camera cover retracts and moves toward its initial position before the camera application is closed) during the entire process of shooting using the camera application.

[0206] In some embodiments, the electronic device 100 may stop detecting the position of the camera cover after the camera cover has moved to its target position. It will be appreciated that the target position of the camera cover is the furthest position to which the camera cover can move. When the camera cover is in its target position, it will not collide with the focus motor. The electronic device 100 may directly move the focus motor to its target position. The above embodiment can save power consumption in the electronic device 100.

[0207] It should be noted that, without causing any 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 above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or make equivalent replacements for some of the technical features therein. However, 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 embodiments of the present application.

Claims

1. A focusing method used for an electronic device comprising a camera module and a camera cover, wherein the camera module comprises a focusing motor characterized in that launch the camera application using an electronic device and determine the first target position to which the focusing motor should move; move the chamber lid using an electronic device; when the camera cover is moved to the first position, and the distance between the first position and the first target position is greater than or equal to the first distance, using the electronic device, moves the focusing motor to the first target position, wherein the first position is less than the target position of the camera cover.

2. The method according to claim 1, in which, before moving the camera cover to the first position, when the camera cover is moved to the second position, and the distance between the second position and the first target position is less than the first distance, the focusing motor is moved to the third position using an electronic device, wherein 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, in which, before moving the chamber cover to the first position, additionally in the process in which the focusing motor moves to the third position, the camera cover is continued to be moved by means of an electronic device; and 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 focusing motor is moved to the fifth position by means of an electronic device, wherein the distance between the fourth position and the fifth position is greater than or equal to the first distance.

4. The method according to paragraph 3, in which, after moving the chamber cover to the fourth position, the first operational information is additionally displayed using an electronic device, wherein the first operational information is used to inform the user about the occurrence of an error when moving the chamber cover.

5. The method according to claim 2, in which, before moving the chamber cover to the first position, additionally during the process in which the focusing motor moves to the third position, the camera cover continues to be moved by means of an electronic device; when the camera cover is moved to the sixth position, wherein 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, using the electronic device, the focusing motor is moved to the seventh position, wherein 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 moving the camera cover to the sixth position, additionally, when the focusing motor moves to the third position, the movement of the focusing motor is stopped using an electronic device.

7. The method according to any one of paragraphs 1-6, in which after the application for working with the camera is started by the electronic device, after the first start period for moving the camera cover, a start is carried out by the electronic device for moving the focusing motor, or a start is carried out simultaneously for moving the camera cover and the focusing motor.

8. The method according to any one of paragraphs 1-7, in which after moving the chamber cover to the first position, the electronic device further continues to move the chamber cover until the chamber cover reaches its target position.

9. The method according to claim 8, in which after moving the chamber cover to the target position of the chamber cover, additionally hold the chamber cover in the target position of the chamber cover using an electronic device; when the target position to which the focusing motor is to move changes from the first target position to the third target position, the focusing motor is moved to the third target position by means of an electronic device.

10. The method according to any one of paragraphs 1-9, in which the first distance is a safety distance between the focusing motor and the camera cover.

11. An electronic device, wherein the electronic device comprises a camera module, a camera cover, a memory, and a processor, the camera module is configured to capture an image, the camera module comprises a lens and a focusing motor, the focusing motor is configured to move the lens to perform focusing, the camera cover is configured to provide space for moving the camera module and to protect the internal structure of the electronic device, the memory is configured to store a computer program, and the processor is configured to run the computer program, so that the electronic device performs the method according to any one of claims 1-10.

12. A machine-readable information carrier, characterized in that it contains instructions, and when the instructions are executed on an electronic device, the electronic device is capable of performing the method according to any of paragraphs 1-10.

13. A computer program product containing machine instructions, wherein when executing the machine instructions on an electronic device, the electronic device is capable of performing the method according to any of paragraphs 1-10.