Focusing method and electronic equipment

CN119895884APending Publication Date: 2025-04-25HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202380067056.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2022-12-30
Filing Date
2023-09-08
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

In existing shooting functions, image blur problems often occur, resulting in poor shooting results. In particular, the blur problem caused by the movement of the focus motor when the image sensor is being exposed cannot be effectively solved.

Method used

Move the focus motor during the period when the image sensor is not exposed, change the distance between the lens and the image sensor to focus, and ensure that the focus operation is performed during the non-exposure period to avoid image blur caused by the movement of the focus motor during the exposure process.

Benefits of technology

By only driving the motor to focus during the non-exposure period, the clarity of the captured image is significantly improved and the blur problem caused by the movement of the focus motor during the exposure process is avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119895884A_ABST
    Figure CN119895884A_ABST
Patent Text Reader

Abstract

The invention discloses a focusing method and electronic equipment, and relates to the technical field of cameras. The method comprises the steps that a first event is responded, and the first event is used for triggering focusing, judging that an image sensor is not exposed, and driving a motor to move so as to change the distance between a lens and the image sensor for focusing; and in response to the first event, judging that the image sensor is in exposure, and after the exposure of the image sensor is finished, driving the motor to move so as to change the distance between the lens and the image sensor for focusing. Therefore, the motor can be controlled to change the distance between the lens and the image sensor only in the non-exposure time period, focusing is realized, and the definition of a shot image is ensured.
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 filed with the State Intellectual Property Office on December 30, 2022, with application number 202211729785.7 and invention name “A focusing method and electronic device”, the entire contents of which are incorporated by reference into this application. Technical Field

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

[0003] Mobile phones, tablets, cameras and other electronic devices usually provide the function of taking pictures or videos.

[0004] However, the inventors discovered during the implementation of the embodiments of the present application that the existing shooting function often results in blurred images, resulting in poor shooting effects.

[0005] Summary of the Invention

[0006] In view of this, the present application provides a focusing method and electronic device, in which the motor moves only during the non-exposure period to change the distance between the lens and the image sensor for focusing, thereby ensuring the clarity of the captured image.

[0007] In a first aspect, the present application provides a focusing method, which is applied to an electronic device including a lens, an image sensor and a motor. For example, the electronic device can be a mobile phone, a tablet, a camera, etc. The lens is used to transmit the light of the photographed object to the image sensor, the image sensor is used to convert the light signal corresponding to the light into an electrical signal for exposure, and the motor is used to drive the lens to move for focusing. In response to a first event, the first event is used to indicate focus, it is determined that the image sensor is not being exposed, and the motor is driven to move to change the distance between the lens and the image sensor for focusing. In response to the first event, it is determined that the image sensor is being exposed, then after the exposure of the image sensor is completed, the motor is driven to move to change the distance between the lens and the image sensor for focusing.

[0008] In summary, with the present invention, even if focus is triggered, the electronic device will not drive the motor to achieve focus during the period when the image sensor is being exposed. Instead, the motor will be driven to achieve focus only during the period when the image sensor is not being exposed (i.e., during the non-exposure period). This ensures the clarity of the captured image.

[0009] In a possible design manner of the first aspect, the first event includes that the clarity of the captured image is lower than a clarity threshold, or that a focus request from the user is received.

[0010] In another possible design of the first aspect, if the level of the first pin (exposure pin) of the image sensor is a first level, it is determined that the image sensor is being exposed. If the level of the first pin of the image sensor is a second level, it is determined that the image sensor is not being exposed.

[0011] That is, whether the image sensor is being exposed can be detected based on the level of the first pin of the image sensor, thereby accurately distinguishing between the exposure time period and the non-exposure time period.

[0012] In another possible design of the first aspect, the electronic device further includes a processor and a first focus chip. The first focus chip is configured to drive the motor to move, and the processor is connected to the first focus chip and to a first pin of the image sensor. The processor being connected to the first pin of the image sensor allows the processor to promptly and accurately detect whether the image sensor is being exposed.

[0013] In this design, determining that the image sensor is not being exposed and driving the motor to move includes: upon detecting that the voltage level of the first pin is at the second level, the processor sends a focus signal to the first focus chip, where the focus signal is used to trigger focus. The first focus chip drives the motor to move in response to the focus signal.

[0014] And, if it is determined that the image sensor is being exposed, the motor is driven to move after the exposure of the image sensor is completed, including: the processor detects that the level of the first pin is a first level, and then the motor is driven to move after the processor detects that the level of the first pin changes to a second level.

[0015] In other words, in this design, the first focus chip receives the focus signal from the processor only during the non-exposure period, and upon receiving the focus signal, the first focus chip drives the motor to move. This ensures that the motor is driven during the non-exposure period to achieve focus.

[0016] In another possible design of the first aspect, the electronic device further includes: a processor and a second focus chip; the second focus chip is configured to store a focus signal and drive the motor to move, the focus signal being used to trigger focus; the second focus chip is connected to the motor and the processor, and the second focus chip is connected to a first pin of the image sensor. The second focus chip being connected to the first pin of the image sensor allows the second focus chip to promptly and accurately detect whether the image sensor is being exposed.

[0017] In this design, in response to a first event, the motor is driven to move if the image sensor is not being exposed. In response to the first event, the motor is driven to move after the image sensor finishes exposing the image sensor. This includes: In response to the first event, the processor sends a focus signal to the second focus chip. The second focus chip stores the focus signal. In other words, regardless of whether the image sensor is being exposed, the processor sends a focus signal to the second focus chip after focus is triggered.

[0018] Furthermore, the second focus chip detects that the level of the first pin is at the second level, and drives the motor to move based on the stored focus signal. The second focus chip detects that the level of the first pin is at the first level, and then drives the motor to move after detecting that the level of the first pin changes to the second level.

[0019] That is, in this design, after receiving the focus signal, the second focus chip can drive the motor to move only during the non-exposure period. In this way, it can be ensured that the motor is driven to move during the non-exposure period to achieve focus.

[0020] In another possible design of the first aspect, the electronic device further includes: a processor, a first focus chip, and a switch module. The switch module is used to store and control the transmission of a focus signal, the focus signal being used to trigger focus, the first focus chip is used to drive the motor to move, the switch module is connected to the first focus chip and the processor, and the switch module is connected to a first pin of the image sensor. The switch module being connected to the first pin of the image sensor allows the switch module to promptly and accurately detect whether the image sensor is being exposed.

[0021] In this design, in response to a first event, it is determined that the image sensor is not being exposed, and the motor is driven to move. In response to the first event, it is determined that the image sensor is being exposed, and after the image sensor has finished exposing, the motor is driven to move. This includes: in response to the first event, the processor sends a focus signal to the switch module. The switch module stores the focus signal. In other words, regardless of whether the image sensor is being exposed, the processor sends a focus signal to the switch module after focus is triggered.

[0022] Furthermore, the switch module detects that the level of the first pin is at the second level, and transmits its stored focus signal to the first focus chip. After the switch module detects that the level of the first pin is at the first level and then detects that the level of the first pin changes to the second level, the switch module transmits its stored focus signal to the first focus chip. In response to the focus signal, the first focus chip drives the motor to move.

[0023] In other words, in this design, after receiving the focus signal, the switch module can send the focus signal to the first focus chip only during the non-exposure period. After receiving the focus signal, the first focus chip can drive the motor to move. This ensures that the motor is driven during the non-exposure period to achieve focus.

[0024] In another possible design of the first aspect, driving the motor to move includes: driving the motor to move in a first direction. The first direction is along the optical axis of the lens and toward the image sensor, thereby reducing the distance between the lens and the image sensor. Alternatively, the first direction is along the optical axis of the lens and away from the image sensor, thereby increasing the distance between the lens and the image sensor.

[0025] In a second aspect, the present application further provides an electronic device comprising a lens, an image sensor, a motor, a processor, and a memory; the lens is configured to transmit light from a photographed object to the image sensor, the image sensor is configured to convert light signals corresponding to the light into electrical signals for exposure, the motor is configured to drive the lens to move for focusing, and the memory stores computer instructions. When the processor executes the computer instructions, the electronic device performs the following steps:

[0026] In response to a first event, the first event being used to indicate focus, it is determined that the image sensor is not being exposed, and the motor is driven to move to change the distance between the lens and the image sensor for focusing. In response to the first event, it is determined that the image sensor is being exposed, and after the image sensor has finished exposing, the motor is driven to move to change the distance between the lens and the image sensor for focusing.

[0027] In a possible design manner of the second aspect, the first event includes that the clarity of a historically captured image is lower than a clarity threshold, or that a focus request from a user is received.

[0028] In a possible design of the second aspect, if the level of the first pin of the image sensor is the first level, the image sensor is being exposed; if the level of the first pin of the image sensor is the second level, the image sensor is not being exposed.

[0029] In a possible design of the second aspect, the electronic device further includes: a processor and a first focusing chip; the first focusing chip is used to drive the motor to move, the processor is connected to the first focusing chip, and the processor is connected to the first pin of the image sensor.

[0030] When the processor executes the computer instructions, it can also cause the electronic device to perform the following steps:

[0031] When the processor detects that the level of the first pin is the second level, it sends a focus signal to the first focus chip, where the focus signal is used to trigger focus;

[0032] The first focus chip drives the motor to move in response to the focus signal;

[0033] The processor detects that the level of the first pin is a first level, and then drives the motor to move after the processor detects that the level of the first pin changes to a second level.

[0034] In a possible design of the second aspect, the electronic device also includes: a processor and a second focusing chip; the second focusing chip is used to store a focusing signal and drive the motor to move, the focusing signal is used to trigger focusing, the second focusing chip is connected to the motor and the processor, and the second focusing chip is connected to the first pin of the image sensor.

[0035] When the processor executes the computer instructions, the electronic device may also perform the following steps: in response to the first event, the processor sends a focus signal to the second focus chip. The second focus chip stores the focus signal. The second focus chip detects that the level of the first pin is at a second level, and the second focus chip drives the motor to move based on the stored focus signal. The second focus chip detects that the level of the first pin is at the first level, and then drives the motor to move after detecting that the level of the first pin changes to the second level.

[0036] In a possible design of the second aspect, the electronic device also includes: a processor, a first focusing chip and a switch module; the switch module is used to store and control the transmission of a focusing signal, the focusing signal is used to trigger focusing, the first focusing chip is used to drive the motor to move, the switch module is connected to the first focusing chip and the processor, and the switch module is connected to the first pin of the image sensor.

[0037] When the processor executes the computer instructions, it may also cause the electronic device to perform the following steps: In response to a first event, the processor sends a focus signal to the switch module. The switch module stores the focus signal. When the switch module detects that the level of the first pin is at the second level, the switch module sends the stored focus signal to the first focus chip. When the switch module detects that the level of the first pin is at the first level, then after the switch module detects that the level of the first pin changes to the second level, the switch module sends the stored focus signal to the first focus chip. In response to the focus signal, the first focus chip drives the motor to move.

[0038] In one possible design of the second aspect, when the processor executes the computer instructions, the electronic device may further execute the following steps: driving the motor to move in a first direction. The first direction is a direction along the optical axis of the lens and toward the image sensor; or the first direction is a direction along the optical axis of the lens and away from the image sensor.

[0039] In a third aspect, the present application also provides a chip system, which includes an interface circuit and a processor; the interface circuit and the processor are interconnected through lines; the interface circuit is used to receive signals from the memory and send signals to the processor, and the signals include computer instructions stored in the memory; when the processor executes the computer instructions, the chip system executes the method in the first aspect above and various possible designs.

[0040] In a fourth aspect, the present application also provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed, the method in the first aspect and various possible designs described above is executed.

[0041] In a fifth aspect, the present application also provides a computer program product, which includes instructions. When the computer program product runs on a computer, the computer can execute the method in the first aspect and various possible designs according to the instructions.

[0042] It can be understood that the beneficial effects that can be achieved by the electronic device described in the second aspect, the chip system described in the third aspect, the computer storage medium described in the fourth aspect, and the computer program product described in the fifth aspect provided above can refer to the beneficial effects in the first aspect and any possible design method thereof, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] FIG1 is a schematic diagram showing the positions of components of a camera module provided in an embodiment of the present application;

[0044] FIG2 is a schematic diagram of a focusing method according to an embodiment of the present application;

[0045] FIG3 is one of the timing diagrams of focus and exposure provided in an embodiment of the present application;

[0046] FIG4 is a second timing diagram of focus and exposure provided in an embodiment of the present application;

[0047] FIG5 is a hardware structure diagram of an electronic device provided in an embodiment of the present application;

[0048] FIG6 is a flowchart of a focusing method according to an embodiment of the present application;

[0049] FIG7 is a schematic diagram of a mobile phone interface according to an embodiment of the present application;

[0050] FIG8 is a second schematic diagram of a mobile phone interface provided in an embodiment of the present application;

[0051] FIG9 is a diagram showing one of the hardware connection relationships for implementing focus according to an embodiment of the present application;

[0052] FIG10 is one of the hardware interaction diagrams for implementing focus according to an embodiment of the present application;

[0053] FIG11 is a third timing diagram of focus and exposure provided in an embodiment of the present application;

[0054] FIG12 is a second flowchart of the focusing method provided in an embodiment of the present application;

[0055] FIG13 is a second diagram of hardware connection relationships for implementing focus according to an embodiment of the present application;

[0056] FIG14 is a second diagram of hardware interaction for implementing focus according to an embodiment of the present application;

[0057] FIG15 is a fourth timing diagram of focus and exposure provided in an embodiment of the present application;

[0058] FIG16 is a third diagram of hardware connection relationships for implementing focus according to an embodiment of the present application;

[0059] FIG17 is a third diagram of hardware interaction for implementing focus according to an embodiment of the present application;

[0060] FIG18 is a fifth timing diagram of focus and exposure provided in an embodiment of the present application;

[0061] FIG19 is a structural diagram of the chip system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0062] The following describes in detail embodiments of the present application, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0063] In the description of this application, it should be understood that the terms "inside", "outside", etc. indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing this application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on this application.

[0064] To facilitate a clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. For example, the first limiting portion and the second limiting portion are merely used to distinguish between different limiting portions and do not limit their order. Those skilled in the art will understand that the words "first" and "second" do not limit the quantity or execution order, and the words "first" and "second" do not necessarily mean that they are different.

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

[0066] In this application, unless otherwise specified or limited, the terms "connected" and "connection" should be understood in a broad sense. For example, they can refer to fixed connection, detachable connection, or integration; mechanical connection, electrical connection; direct connection, indirect connection through an intermediate medium, internal communication between two components, or interaction between two components. Those skilled in the art will understand the specific meanings of the above terms in this application based on specific circumstances.

[0067] In order to make the purpose, technical solutions and advantages of this application more clear, this application is further described in detail below with reference to the accompanying drawings and embodiments.

[0068] The focusing method provided in the embodiments of the present application can be applied to electronic devices with camera functions, that is, to electronic devices that can take pictures (including taking pictures or videos).

[0069] For example, the electronic devices may include smartphones, personal digital assistants (PDAs), tablet computers, laptop computers, video cameras, video recorders, still cameras, smart watches, smart wristbands, cellular phones, car computers, and other electronic devices with camera functions. The embodiments of the present application do not impose any particular restrictions on the specific form of the electronic devices.

[0070] During the shooting process of an electronic device, it can usually improve the shooting performance through processing such as automatic focus (AF) and automatic exposure (AE).

[0071] Autofocus utilizes the principle of light reflection from the object being photographed. The image sensor receives the reflected light and then adjusts the distance between the lens and the image sensor through computational processing to shift the focal point of the object to the image sensor, achieving a clear image. In other words, autofocus ensures image clarity.

[0072] The focus motor can be used to drive the lens to move to adjust the distance between the lens and the image sensor. It should be understood that the whole composed of the focus motor, lens and image sensor is what is commonly referred to as a camera module.

[0073] For example, a voice coil motor (VCM) is used as the focus motor. The VCM consists of a rotor and a stator. The rotor holds the lens and can move relative to the stator along the optical axis. The image sensor is mounted on the side of the VCM away from the lens. The lens moves with the rotor, ensuring that the focal point of the lens' image of the subject is located on the image sensor. This ensures a clear image of the subject.

[0074] Figure 1 illustrates the positional relationship between the voice coil motor (VCM), lens, and image sensor in a camera module. As shown in Figure 1, the VCM 103 and lens 102 can be positioned on the light-collecting side of the image sensor 104. The VCM 103 can be provided with a lens port 105, with the lens 102 positioned within the port. The light-exiting side of the lens 102 aligns with the light-collecting side of the image sensor 104. The lens 102 collects light from the subject, and the VCM 103 drives the lens 102 to move along its optical axis L, shifting the focal point of the subject to the image sensor 104, thereby achieving clear imaging.

[0075] For example, referring to Figure 2 , when lens 102 is at position A to capture a "sailboat," the image of the "sailboat" is not in focus on image sensor 104, and the captured image of the "sailboat" is unclear. Continuing with Figure 2 , voice coil motor 103 drives lens 102 to move along optical axis L, in a direction closer to image sensor 104. When it moves to position B, the image of the "sailboat" is in focus on image sensor 104, and the captured image of the "sailboat" is clear.

[0076] It should be noted that this article primarily describes focusing by using a focus motor to move the lens, thereby changing the distance between the lens and the image sensor. However, in actual implementation, this is not limiting. For example, a motor could also be used to move the image sensor, thereby changing the distance between the lens and the image sensor for focusing.

[0077] Furthermore, automatic exposure is the process of calculating the brightness of an image after it is captured, determining the exposure value for that image, and further calculating exposure parameters such as exposure time and gain (ISO) for a new image. Based on these exposure parameters, the image sensor's exposure is then controlled to capture a new image with appropriate brightness. In other words, automatic exposure ensures that the overall brightness of the image is neither too dark nor too bright.

[0078] In some embodiments, during the capture process of the electronic device, the timing between the exposure of the image sensor 104 and the movement of the lens 102 by the voice coil motor 103 is not mutually constrained. That is, the timing relationship between the exposure of the image sensor 104 and the movement of the lens 102 by the voice coil motor 103 includes at least one or more of the following situations: before the image sensor 104 is exposed, the voice coil motor 103 moves the lens 102; during the exposure of the image sensor 104, the voice coil motor 103 moves the lens 102; and after the exposure of the image sensor 104 ends, the voice coil motor 103 moves the lens 102.

[0079] For example, referring to FIG. 3 , when capturing the k-1th, kth, and k+1th frames, the image sensor 104 is exposed once. When capturing the k-1th frame, before and during the exposure of the image sensor 104, such as around T1, the focus motor (such as the voice coil motor 103) moves, thereby driving the lens 102 to move and achieve focus. When capturing the kth frame, during the exposure of the image sensor 104, such as during the time period T2-T3, the focus motor (such as the voice coil motor 103) moves, thereby driving the lens 102 to move and achieve focus. When capturing the k+1th frame, after the exposure of the image sensor 104 ends, such as after T4, the focus motor (such as the voice coil motor 103) moves, thereby driving the lens 102 to move and achieve focus.

[0080] However, if the voice coil motor 103 moves the lens 102 during the exposure process of the image sensor 104, the captured image will be blurred. For example, in the example of FIG3 , both the k-1th frame and the kth frame will be blurred.

[0081] Based on the above problems, an embodiment of the present application provides a focusing method that can be applied to the above-mentioned electronic device shooting (including taking pictures or videos) scenario. Among them, the electronic device can control the focus motor to move when the image sensor is not exposed (including before exposure and after exposure), thereby driving the lens to move. When the image sensor is exposed, the focus motor will not be controlled to move, thereby not driving the lens to move. In this way, the problem of image blur caused by the movement of the focus motor during the exposure process can be avoided, and the clarity of the captured image can be ensured.

[0082] For example, referring to FIG4 , the image sensor is exposed during the time periods t1-t2, t3-t4, and t5-t6, but not during the time periods t2-t3, t4-t5, and t6-t7. The electronic device can then control the focus motor to move during the time periods t2-t3, t4-t5, and t6-t7, thereby driving the lens to move. However, during the time periods t1-t2, t3-t4, and t5-t6, the focus motor is not controlled to move, thereby not driving the lens to move.

[0083] Referring to Figure 5 , a hardware structure diagram of an electronic device provided in an embodiment of the present application is shown. As shown in Figure 5 , taking a mobile phone as an example, the electronic device may include a processor 510, a memory 520, a camera module 530, and a display screen 540. The processor 510, the memory 520, the camera module 530, and the display screen 540 may be connected via a bus (e.g., an IIC bus).

[0084] The processor 510 may include one or more processing units, for example, 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). Different processing units may be independent devices or integrated into one or more processors.

[0085] The processor 510 can be the nerve center and command center of the electronic device. The processor 510 can generate operation control signals based on instruction operation codes and timing signals to complete the control of instruction fetching and execution.

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

[0087] The memory 520 is coupled to the processor 510 and is used to store various software programs and / or multiple sets of instructions. The memory 520 can be used to store computer executable program code, which includes instructions. The processor 510 executes various functional applications and data processing of the electronic device by running the instructions stored in the memory 520. The memory 520 may include a program storage area and a data storage area. Among them, the program storage area may 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 may store data created during the use of the electronic device (such as audio data, image data to be displayed, etc.), etc. In addition, the memory 520 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.

[0088] The camera module 530 can be used in electronic devices to achieve image capture functions by combining an image signal processor (ISP), a video codec, a GPU, a display 540, and an application processor. It should be noted that, as mentioned above, the camera module 530 may specifically include a focus motor, a lens, and an image sensor.

[0089] The ISP processes data from the camera module 530. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the image sensor within the camera module 530. The light signal is converted into an electrical signal, which the image sensor then transmits to the ISP for processing, transforming it into a visible image. The ISP can also perform algorithmic optimization on image noise, brightness, and skin tone.

[0090] The ISP can optimize the exposure parameters and focus parameters of the shooting scene to achieve automatic exposure, autofocus, etc. For example, the ISP can use the 3A algorithm to determine the exposure parameters and focus parameters. Among them, 3A includes autofocus, autoexposure and automatic white balance. Regarding the 3A algorithm, this article will not go into details. In addition, the focus parameters determined by the ISP can be sent to the driver (such as the focus chip) to drive the motor to move. The exposure parameters determined by the ISP can be sent to the driver via the bus, thereby driving components such as the image sensor and shutter to achieve exposure.

[0091] Each camera module 530 may have a corresponding ISP (or ISP module) to perform image processing corresponding to the camera module 530. Furthermore, the ISP may be provided separately from the corresponding camera module 530, such as being integrated into the processor 510. Alternatively, the ISP may be provided within the corresponding camera module 530. This embodiment of the present application does not specifically limit this.

[0092] The camera module 530 uses a focus motor to move the lens to achieve focus, and uses an image sensor to receive light projected from the lens to achieve exposure.

[0093] When the lens is located on the front of the electronic device, it can be used to capture the scene on the front side of the electronic device. When the lens is located on the back of the electronic device, it can be used to capture the scene on the back side of the electronic device. When shooting, the user can select the appropriate lens according to the shooting requirements.

[0094] It should be understood that when the lens is set on the front of the electronic device, it can be installed at any position on the front of the electronic device except the display screen 540, such as the left side of the earpiece, the upper middle of the electronic device, the lower part of the electronic device (or chin), or the four corners of the electronic device; in fact, for a full-screen mobile phone, the lens can also be located below the display screen 540. When the lens is set on the back of the electronic device, it can be installed at any position on the back of the electronic device, such as the upper left corner or the upper right corner. In some other embodiments, the lens may not be set on the main body of the electronic device, but on an edge protruding relative to the main body of the electronic device, or on a component that is movable or rotatable relative to the electronic device, and the component can be extended or rotated from the main body of the electronic device.

[0095] The focus motor may be a voice coil motor, a piezoelectric motor, a shape memory alloy (SMA), etc. This embodiment of the present application does not specifically limit this.

[0096] The image sensor (also known as a photosensitive element) is used to capture still images or videos. The object being photographed is projected onto the image sensor through the lens, generating an optical image. The image sensor can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The image sensor converts the optical signal into an electrical signal, which is then transmitted to the ISP for conversion into a digital image signal, such as an image signal in a standard RGB or YUV format.

[0097] Furthermore, the image sensor includes an exposure pin (Pin) (also referred to as a first pin). When the image sensor is being exposed, the level of the exposure pin is a first level, such as a high level; when the image sensor is not being exposed, the level of the exposure pin is a second level, such as a low level.

[0098] The embodiment of the present application does not limit the number of camera modules 530 provided. The number can be one, two, three, four, or even more. For example, one or more camera modules 530 can be provided on the front of the electronic device, and / or one or more camera modules 530 can be provided on the back of the electronic device. When multiple camera modules 530 are provided, the multiple camera modules 530 can be identical or different, for example, the multiple camera modules 530 can have different lens optical parameters, different lens installation positions, different lens shapes, etc. Exemplarily, the multiple camera modules 530 can include periscope telephoto cameras, main cameras, wide-angle cameras, and other camera modules.

[0099] The display screen 540 can be used to display images, videos, interfaces, etc. In the embodiment of the present application, the display screen 540 is used to display various interfaces of the system output of the electronic device 100. For details, please refer to the relevant description of the subsequent embodiments. The display screen 540 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light emitting diode (QLED), etc.

[0100] It is understood that the structures illustrated in the embodiments of this application do not constitute specific limitations on the electronic device. In other feasible implementations of this application, the electronic device may include more or fewer components than shown, or combine or separate certain components, or arrange the components differently. The specific configuration can be determined based on the actual application scenario and is not limited here.

[0101] In some embodiments, referring to FIG5 , the camera module 530 of the electronic device may further include a focus chip. The focus chip stores a driver for driving the focus motor.

[0102] In a specific implementation, the focus chip can also store a focus signal and drive the focus motor to work based on the focus signal at an appropriate time (such as when the image sensor is not exposed). The focus signal is used to trigger focus.

[0103] In another specific implementation, the camera module 530 of the electronic device may include a focus chip and a switch module for the focus chip. The switch module may be used to store a focus signal and send a focus signal to the focus chip at an appropriate time (e.g., when the image sensor is not exposed), thereby driving the focus motor.

[0104] For ease of explanation, a focus chip that stores a driver program but does not store a focus signal may be referred to as a first focus chip, and a focus chip that can store a focus signal may be referred to as a second focus chip. Furthermore, a device that stores a focus signal, such as a second focus chip or a switch module, may be referred to as a focus storage device.

[0105] Furthermore, the components shown in FIG5 can be implemented by hardware, software, or a combination of software and hardware, which is not specifically limited in the present embodiment.

[0106] The focusing method provided in the embodiment of the present application can be implemented in an electronic device having the above-mentioned hardware structure.

[0107] In this application, the following two methods are provided for controlling the focus motor to move during the period when the image sensor is not exposed, i.e., during the non-exposure period:

[0108] Method 1: When focus is required and during non-exposure periods, a focus signal is transmitted to the first focus chip. The focus signal is used to trigger focus. After receiving the focus signal, the first focus chip can drive the focus motor to move. When focus is required but during exposure periods, no focus signal is transmitted to the first focus chip, thereby preventing the focus motor from moving.

[0109] In method 1, a focus signal is transmitted to the first focus chip only during the non-exposure period, thereby controlling the focus motor to move during the non-exposure period. Of course, in method 1, a second focus chip can also be used to drive the focus motor to move, and this application does not specifically limit this.

[0110] Method 2: When focus is required, the electronic device stores a focus signal in a focus storage device (such as a second focus chip, a switch module, etc.). The focus signal is used to trigger focus. During non-exposure periods, the focus motor is driven based on the focus signal stored in the focus storage device; during exposure periods, the focus motor is not driven.

[0111] The second method is to store the focus signal and drive the focus motor to move based on the stored focus signal only during the non-exposure period, thereby controlling the focus motor to move during the non-exposure period.

[0112] The focusing method of the embodiment of the present application will be described below with respect to the above-mentioned method 1 and method 2 respectively.

[0113] Method 1: When there is a focus requirement, a focus signal is transmitted to the first focus chip only during a non-exposure period.

[0114] 6 , using the first approach, the focusing method provided by the embodiment of the present application includes:

[0115] S601: The electronic device displays a first interface, where the first interface is a viewfinder interface and includes a first image.

[0116] The first interface may be a viewfinder interface before shooting. For example, the first interface is the viewfinder interface 701 before shooting shown in FIG7 . Alternatively, the first interface may be a viewfinder interface during shooting. For example, the first interface is the viewfinder interface 702 during video shooting shown in FIG7 .

[0117] S602: The electronic device determines that a new frame of image needs to be captured.

[0118] It should be understood that when the camera application is running in the foreground, new image frames need to be continuously displayed in the viewfinder interface so that the viewfinder screen can be updated in real time. For example, at 1 minute and 20 seconds into the video shooting, that is, "00:01:20", the mobile phone can display interface 801 shown in Figure 8. Subsequently, at 1 minute and 25 seconds into the video shooting, that is, "00:01:25", the mobile phone can display interface 802 shown in Figure 8. Obviously, interface 802 is different from interface 801. Compared with interface 801, interface 802 includes seagulls flying over the sea.

[0119] Accordingly, when the camera application is running in the foreground, it is necessary to continuously capture new images. Therefore, the electronic device can determine whether a new frame of image needs to be captured based on whether the camera application is running in the foreground. After displaying a frame of image (such as the first image), if the camera application continues to run in the foreground, it is determined that a new frame of image needs to be captured; if the camera application exits the foreground, it is determined that a new frame of image does not need to be captured.

[0120] After the electronic device determines that a new frame of image needs to be captured, it needs to capture a new frame of image through the camera module. In the process of capturing a new frame of image, the electronic device can also automatically expose the image to ensure that the image is captured with appropriate brightness, as shown in S603 below.

[0121] In addition, during the entire shooting process, that is, from opening the camera application to exiting the camera application running in the foreground, the electronic device can also trigger autofocus based on focus requirements to ensure that a clear image is captured, as shown in S604 below.

[0122] S603: The electronic device controls the exposure of the image sensor.

[0123] The image sensor can achieve exposure using either global shutter or rolling shutter. Global shutter exposure means that during the scanning process (converting optical signals into electrical signals), all rows are exposed simultaneously and their exposure ends simultaneously. Rolling shutter exposure means that during the scanning process (converting optical signals into electrical signals), exposure begins with the first row, and continues until the second row is exposed after a row cycle has completed. This continues until exposure begins at row N after row N-1.

[0124] S604: When there is a focus requirement, if the image sensor is not being exposed, a focus signal is sent to the first focus chip to drive the focus motor to move; if the image sensor is being exposed, a focus signal is sent to the first focus chip after the image sensor finishes exposure.

[0125] The focus signal is used to trigger focus.

[0126] It should be understood that not every frame of image capture requires focus, i.e., autofocus is required. If focus is determined to be required, further triggering for focus is required.

[0127] Exemplarily, after determining that a new frame of image needs to be displayed, the electronic device (such as an ISP in an electronic device) can determine whether the position of the lens needs to be adjusted based on one or more frames of image that have been captured, that is, determine whether there is a focus requirement. Exemplarily, each time the electronic device captures an image (such as a first image), it can determine whether the position of the lens needs to be adjusted when capturing a new frame of image based on the clarity of the image. For example, if the clarity of the first image is higher than or equal to the clarity threshold, when capturing a new frame of image, the position of the lens when capturing the first image can be kept unchanged. That is, there is no focus requirement. If the clarity of the first image is lower than the clarity threshold, when capturing a new frame of image, the position of the lens needs to be adjusted to change the distance between the lens and the image sensor. That is, there is a focus requirement.

[0128] As another example, the electronic device detects a focus request from the user, such as detecting that the user clicks on position 703 in the viewfinder interface 701 shown in FIG. 7 , and determines that the position of the lens needs to be adjusted, that is, determines that there is a focus requirement.

[0129] For ease of explanation, the event indicating a focus requirement may be referred to as a first event. That is, the first event may be that the clarity of a historically captured image is lower than a clarity threshold, or the first event may be that a focus request from a user is received.

[0130] However, since there is no mutual constraint between the time when the focus requirement is determined and the exposure time of the image sensor, the state of the image sensor may be in the following three situations when the focus requirement is determined:

[0131] In the first case, when the focus requirement is determined, the image sensor has not started exposure, that is, S603 has not yet been executed.

[0132] In the second case, when the focus requirement is determined, the image sensor is being exposed, that is, S603 is being executed.

[0133] In case three, when the focus requirement is determined, the image sensor has already finished exposure, that is, S603 has already been executed.

[0134] Among them, Cases 1 and 3 both involve situations where the image sensor is not being exposed when a focus requirement is determined. In this case, using S604, if the image sensor is not being exposed when a focus requirement is determined, a focus signal can be sent to the first focus chip. After receiving the focus signal, the first focus chip drives the focus motor to move a specific distance in a specific direction, thereby driving the lens to move for focusing. In this way, a focus signal can be transmitted to the first focus chip during the non-exposure period.

[0135] If it is the second case, it belongs to the situation where the image sensor is being exposed when the focus requirement is determined. In this case, S604 is adopted. When the focus requirement is determined, the image sensor is being exposed. At this time, the focus signal may not be sent to the first focus chip first, but the focus signal may be sent to the first focus chip after the exposure is completed (that is, S603 is completed). After receiving the focus signal, the first focus chip drives the focus motor to move a specific distance in a specific direction, thereby driving the lens to move. In this way, the focus signal will not be transmitted to the first focus chip during the exposure time period, but will wait until the non-exposure time period before transmitting the focus signal to the first focus chip.

[0136] It should be noted that information such as the specific direction and specific distance of the focus motor movement can be determined by the Hall effect chip in the camera module or the 3A algorithm in the ISP. The specific direction includes the direction along the optical axis L and close to the image sensor, or the direction along the optical axis L and away from the image sensor. For the specific implementation of determining information such as the specific direction and specific distance, please refer to the description of the relevant existing technology and will not be elaborated here.

[0137] S605: The electronic device captures and obtains a second image.

[0138] The second image is a new frame of image.

[0139] For example, after the exposure is completed, the image sensor may transmit the electrical signal to the ISP, and then the ISP converts the electrical signal into a digital image signal, such as an image signal in a standard RGB, YUV, or other format, thereby capturing a second image.

[0140] S606: The electronic device displays a second interface, where the second interface is a viewfinder interface and includes a second image.

[0141] The second interface may be a framing interface before shooting or a framing interface during shooting.

[0142] After the second image is captured, the electronic device may display the second image, thereby updating the viewfinder screen.

[0143] Furthermore, in S604, the electronic device may obtain, via the processor, an exposure state of the image sensor, where the exposure state includes both exposure and non-exposure. Furthermore, the processor may transmit a focus signal to the first focus chip based on the focus parameters only when the exposure state is non-exposure, thereby transmitting the focus signal to the first focus chip only during non-exposure periods.

[0144] In one specific implementation, as shown in Figure 9 , the processor is connected to the exposure pin of the image sensor. Furthermore, the processor is connected to the first focus chip via a bus. The first focus chip can drive the focus motor, which in turn drives the lens to achieve focus. When the image sensor is exposing, the exposure pin is at a first level, such as a high level; when the image sensor is not exposing, the exposure pin is at a second level, such as a low level.

[0145] In this implementation, referring to FIG10 , S604 specifically includes:

[0146] S1001: The processor determines that there is a focus requirement.

[0147] The processor may be an ISP (image processor) or an AP (application processor).

[0148] And, if it is determined that there is a focus requirement, it indicates that focus needs to be triggered.

[0149] S1002: The processor detects that the level of the exposure pin of the image sensor is a first level.

[0150] The first level is the operating level during exposure. That is, when the level of the exposure pin is at the first level, it indicates that the image sensor is being exposed. At this time, the processor does not need to send a focus signal to the first focus chip, so the first focus chip does not receive a focus signal during the exposure period.

[0151] For example, in Figure 11, t1-t2, t3-t4, and t5-t6 are all exposure time periods, and moments s1, s2, and s3 in Figure 11 are the moments when a focus request is determined. Taking t1-t2 as an example, at moment s1 between t1 and t2, a focus request is determined. At this time, because the image sensor is currently being exposed, the processor does not immediately send a focus signal to the first focus chip. Consequently, the first focus chip does not receive the focus signal and does not drive the focus motor.

[0152] S1003: The processor detects that the level of the exposure pin of the image sensor is a second level.

[0153] The second level is an idle level when not being exposed. That is, when the level of the exposure pin is the second level, it indicates that the image sensor is not being exposed.

[0154] S1004: The processor sends a focus signal to the first focus chip through the bus.

[0155] That is, when the image sensor is not exposed, the processor sends a focus signal to the first focus chip.

[0156] For example, in Figure 11, periods t2-t3, t4-t5, and t6-t7 are all non-exposure periods. For example, during period t2-t3, the processor determines that a focus request is required at moment s1 between t1-t2. Since t1-t2 is the exposure period, the processor will not detect that the image sensor is not exposing until t2. Therefore, the processor will not send a focus signal to the first focus chip until t2-t3. Subsequently, the first focus chip will receive the focus signal.

[0157] S1005 : In response to the focus signal, the first focus chip drives the focus motor to move.

[0158] For example, referring to Figure 11, each time the first focus chip receives a focus signal from the processor, it drives the focus motor to move. Taking t2-t3 as an example, after receiving the focus signal, the first focus chip then sends a drive signal to the focus motor, thereby driving the focus motor to move.

[0159] When the focus motor moves, it also moves the lens, causing the distance between the lens and the image sensor to change. For example, when the focus motor moves the lens from position A to position B as shown in Figure 2, the distance between the lens and the image sensor decreases.

[0160] Method 2: When there is a focus requirement, the focus signal is stored, and the focus motor is driven to move based on the stored focus signal only during the non-exposure period.

[0161] Referring to FIG. 12 , in the second embodiment, the focusing method provided by the present application includes:

[0162] S1201: The electronic device displays a first interface, which is a shooting interface and includes a first image. For details, please refer to the description of S601 above, which will not be repeated here.

[0163] S1202: The electronic device determines that a new frame of image needs to be captured. For details, please refer to the description of S602 above, which will not be repeated here.

[0164] After determining that a new frame of image needs to be taken, the electronic device needs to take a new frame of image through the camera module. In the process of taking a new frame of image, the electronic device can also ensure that the image with appropriate brightness is taken by automatic exposure, as shown in S1203 below.

[0165] In addition, during the entire shooting process, that is, from opening the camera application to exiting the camera application running in the foreground, the electronic device can also trigger autofocus based on focus requirements to ensure that a clear image is captured, as shown in S1204-S1205 below.

[0166] S1203: The electronic device controls the exposure of the image sensor. For details, please refer to the description of S603 above, which will not be repeated here.

[0167] S1204: When there is a focus requirement, the electronic device sends a focus signal to the focus storage device, and the focus storage device stores the focus signal.

[0168] Among them, the focus storage device is a component of the camera module, and the focus signal is used to trigger focus.

[0169] In method 2, after determining that there is a focus requirement, the electronic device first sends a focus signal to the focus storage device regardless of whether the image sensor is exposed, and the focus storage device stores the focus signal so that the focus signal can be used to drive the focus motor to move at an appropriate time later (such as during the time period when the image sensor is not exposed).

[0170] S1205: If the image sensor is not being exposed, drive the focus motor to move according to the stored focus signal. If the image sensor is being exposed, wait until the image sensor finishes exposure, and then drive the focus motor to move according to the stored focus signal.

[0171] Similar to S604 above, after the focus storage device stores the focus signal, the state of the image sensor may be the following three situations:

[0172] In case 1, after the focus storage device stores the focus signal, the image sensor has not started exposure, that is, S1203 has not yet started to be executed.

[0173] In the second case, after the focus storage device stores the focus signal, the image sensor is being exposed, that is, S1203 is being executed.

[0174] Case three: after the focus storage device stores the focus signal, the image sensor has finished exposing, that is, S1203 has been completed.

[0175] Cases 1 and 3 both occur when the image sensor is not currently exposing the image after the focus storage device stores the focus signal. In this case, if the image sensor is not currently exposing the image, S1205 can be used to drive the focus motor in a specific direction and distance based on the stored focus signal, thereby driving the lens to focus. This allows the focus motor to be driven based on the stored focus signal during non-exposure periods.

[0176] If the second scenario occurs, the image sensor is currently being exposed after the focus signal is stored in the focus storage device. In this case, S1205 is used, and since the image sensor is currently being exposed, the focus motor can be driven not according to the stored focus signal. Instead, the focus motor can be driven in a specific direction and distance based on the stored focus signal after the exposure is complete (i.e., after S1203 is executed), thereby moving the lens. In this manner, the focus motor is not driven during the exposure period, but rather during the non-exposure period.

[0177] Similarly, for the specific implementation of determining information such as a specific direction and a specific distance, please refer to the description in the relevant prior art, which will not be described in detail here.

[0178] It can be seen from this that by adopting S1204 and S1205, the focus motor can be driven to move only during the non-exposure period.

[0179] Furthermore, compared to step S604 in method 1, in method 2, after determining that a focus requirement exists, a focus signal is sent to the focus storage device in the camera module. Then, when the image sensor is not being exposed, the focus signal in the focus storage device is used to drive the focus motor to move. This eliminates the need to send a focus signal to the camera module after detecting that the image sensor is not being exposed. This allows for faster driving of the focus motor after detecting that the image sensor is not being exposed, reducing latency. This ensures that the focus motor is driven to move the lens during non-exposure periods.

[0180] S1206: The electronic device captures and obtains a second image. For details, please refer to the description of S605 above, which will not be repeated here.

[0181] S1207: The electronic device displays a second interface, which is a viewfinder interface and includes a second image. For details, please refer to the description of S606 above, which will not be repeated here.

[0182] Furthermore, in S1205, the electronic device may obtain the exposure state of the image sensor through the focus storage device, where the exposure state includes two types: exposed and non-exposed. Furthermore, the focus storage device may drive the focus motor to move according to the stored focus signal only when the exposure state is non-exposed, thereby driving the focus motor to move during non-exposure periods.

[0183] In one specific implementation, referring to FIG13 , the focus storage device is a second focus chip. The second focus chip is connected to the exposure pin of the image sensor and is also connected to the processor via a bus. The second focus chip can also drive the focus motor, which in turn drives the lens to achieve focus. When the image sensor is exposing, the exposure pin is at a first level; when the image sensor is not exposing, the exposure pin is at a second level.

[0184] In this implementation, referring to FIG. 14 , S1204 further includes:

[0185] S1401: The processor determines that there is a focus requirement.

[0186] The processor may be an ISP (image processor) or an AP (application processor).

[0187] S1402: The processor sends a focus signal to the second focus chip through the bus.

[0188] The difference from S1004 in the first method is that in S1402, regardless of whether the image sensor is being exposed, the processor will send a focus signal to the second focus chip after determining that there is a focus requirement.

[0189] For example, t1-t2 and t3-t4 in Figure 15 are both exposure time periods, and moments s1, s2, and s3 in Figure 15 are the times when a focus request is determined. Taking t1-t2 as an example, if a focus request is determined at moment s1 between t1 and t2, the processor will still send a focus signal to the second focus chip even if the image sensor is currently being exposed. That is, a focus signal can be sent to the second focus chip even during the exposure time period.

[0190] S1403: The second focus chip stores the focus signal.

[0191] The stored focus signal may be used to subsequently drive the focus motor to move at an appropriate time (ie, during a non-exposure period).

[0192] Continuing to refer to FIG. 14 , S1205 further includes:

[0193] S1404: The second focusing chip detects that the level of the exposure pin of the image sensor is a first level.

[0194] The first level is the operating level during exposure. That is, when the level of the exposure pin is at the first level, it indicates that the image sensor is exposing. At this time, the second focus chip does not need to drive the focus motor, so the focus motor is not driven during the exposure period.

[0195] For example, still taking t1-t2 in Figure 15 as an example, the processor sends a focus signal to the second focus chip at moment s1 within t1-t2, and then the second focus chip completes the focus signal storage before t2. At this time, since the image sensor is being exposed, the second focus chip will not immediately drive the focus motor to move.

[0196] S1405: The second focusing chip detects that the level of the exposure pin of the image sensor is a second level.

[0197] The second level is an idle level when not being exposed. That is, when the level of the exposure pin is the second level, it indicates that the image sensor is not being exposed.

[0198] S1406: The second focus chip drives the focus motor to move according to the stored focus signal.

[0199] That is, the focus motor is driven to move in a specific direction and by a specific distance, so that during a non-exposure period, the focus motor is driven to move based on the stored focus signal.

[0200] For example, in Figure 15, periods t2-t3, t4-t5, and t6-t7 are all non-exposure periods. Taking t2-t3 as an example, the second focus chip receives and stores the focus signal between t1-t2. Since t1-t2 is the exposure period, the second focus chip detects that the image sensor is not exposing until t2. Therefore, the second focus chip waits until t2-t3 to send a drive signal to the focus motor, thereby driving the focus motor.

[0201] Furthermore, compared to S1004 and S1005 in Method 1, in this implementation, after determining that a focus requirement exists, the processor sends a focus signal to the second focus chip. Then, when the image sensor is not being exposed, the second focus chip drives the focus motor to move. This eliminates the need to wait until the image sensor is detected to be non-exposed before sending a focus signal to the second focus chip. This allows the focus motor to be driven more quickly after detecting that the image sensor is not being exposed, reducing latency. This ensures that the focus motor is driven to move the lens during non-exposure periods.

[0202] When the focus motor moves, it drives the lens to move, causing the distance between the lens and the image sensor to change.

[0203] In another specific implementation, see Figure 16 , a switch module is added to the first focus chip, and the focus storage device serves as this switch module. This switch module is connected to the exposure pin of the image sensor and is also connected to the processor and the first focus chip via a bus. The switch module can control the first focus chip to drive the focus motor, which in turn drives the lens to achieve focus. When the image sensor is exposing, the exposure pin is at a first level; when the image sensor is not exposing, the exposure pin is at a second level.

[0204] In this implementation, referring to FIG. 17 , S1204 further includes:

[0205] S1701: The processor determines that there is a focus requirement.

[0206] The processor may be an ISP (image processor) or an AP (application processor).

[0207] S1702: The processor sends a focus signal to the switch module through the bus.

[0208] The difference from S1004 in the first method is that in S1702, regardless of whether the image sensor is being exposed, the processor will send a focus signal to the switch module after determining the focus requirement.

[0209] For example, t1-t2 and t3-t4 in Figure 18 are both exposure time periods, and moments s1, s2, and s3 in Figure 18 are the times when a focus requirement is determined. Taking t1-t2 as an example, if a focus requirement is determined at moment s1 between t1 and t2, the processor will still send a focus signal to the switch module even if the image sensor is currently being exposed. That is, a focus signal can be sent to the switch module even during the exposure time period.

[0210] S1703: The switch module stores the focus signal.

[0211] The stored focus signal may be used to subsequently drive the focus motor to move at an appropriate time (ie, during a non-exposure period).

[0212] Continuing to refer to FIG. 17 , S1205 further includes:

[0213] S1704: The switch module detects that the level of the exposure pin of the image sensor is a first level.

[0214] The first level is the operating level during exposure. That is, when the exposure pin is at the first level, the image sensor is being exposed. At this point, the switch module does not need to send a focus signal to the first focus chip, and the first focus chip does not drive the focus motor. Consequently, the focus motor remains idle during the exposure period.

[0215] For example, still taking t1-t2 in Figure 18 as an example, the processor sends a focus signal to the switch module at time s1 within t1-t2, and then the switch module completes the focus signal storage before t2. At this time, since the image sensor is being exposed, the switch module will not immediately forward the focus signal to the first focus chip, and the first focus chip will not drive the focus motor to move.

[0216] S1705: The switch module detects that the level of the exposure pin of the image sensor is a second level.

[0217] The second level is an idle level when not being exposed. That is, when the level of the exposure pin is the second level, it indicates that the image sensor is not being exposed.

[0218] S1706: The switch module sends a focus signal to the first focus chip.

[0219] That is, during the non-exposure period, a focus signal is sent to the first focus chip.

[0220] For example, in Figure 18, t2-t3, t4-t5, and t6-t7 are all non-exposure time periods. Taking t2-t3 as an example, the switch module receives and stores the focus signal between t1-t2. Since t1-t2 is the exposure time period, the switch module will not detect that the image sensor is not exposing until t2. Therefore, the switch module will not send the focus signal to the first focus chip until t2-t3.

[0221] S1707 : In response to the focus signal, the first focus chip drives the focus motor to move according to the focus signal.

[0222] For example, referring to Figure 18 , each time the first focus chip receives a focus signal from the switch module, it drives the focus motor to move. Taking t2-t3 as an example, after receiving the focus signal, the first focus chip then sends a drive signal to the focus motor, thereby driving the focus motor to move.

[0223] Furthermore, compared to S1004 and S1005 in Method 1, in this implementation, after determining that a focus requirement exists, the processor sends a focus signal to the switch module. Then, when the image sensor is not being exposed, the switch module sends a focus signal to the first focus chip, thereby driving the focus motor to move. This eliminates the need to wait until the image sensor is detected to be non-exposed before sending a focus signal to the switch module. This allows the focus motor to be driven more quickly after detecting that the image sensor is not being exposed, reducing latency. This ensures that the focus motor is driven to move the lens during non-exposure periods.

[0224] When the focus motor moves, it drives the lens to move, causing the distance between the lens and the image sensor to change.

[0225] An embodiment of the present application further provides an electronic device, which may include a memory and one or more processors. The memory and processors are coupled. The memory is configured to store computer program code, which includes computer instructions. When the processor executes the computer instructions, the electronic device may perform the functions or steps of the above-described method embodiments to achieve capture.

[0226] An embodiment of the present application also provides a chip system, as shown in Figure 19, the chip system 1900 includes at least one processor 1901 and at least one interface circuit 1902. The processor 1901 and the interface circuit 1902 can be interconnected via lines. For example, the interface circuit 1902 can be used to receive signals from other devices (such as the memory of an electronic device). For another example, the interface circuit 1902 can be used to send signals to other devices (such as the processor 1901). Exemplarily, the interface circuit 1902 can read instructions stored in the memory and send the instructions to the processor 1901. When the instructions are executed by the processor 1901, the electronic device can perform the various steps in the above embodiments. Of course, the chip system can also include other discrete devices, which is not specifically limited in the embodiment of the present application.

[0227] This embodiment further provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes each function or step in the above method embodiment to achieve shooting.

[0228] This embodiment further provides a computer program product. When the computer program product is run on a computer, it enables the computer to execute each function or step in the above method embodiment to achieve shooting.

[0229] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor can execute the computer-executable instructions stored in the memory to enable the chip to perform the various functions or steps in the above-mentioned method embodiment to achieve shooting.

[0230] Among them, the electronic device, communication system, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.

[0231] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0232] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0233] The units described as separate components may or may not be physically separate, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0234] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0235] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0236] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application and are not intended to limit the present application. Although the present application has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present application may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present application.

Claims

1. A focusing method, characterized in that: Applied to an electronic device, the electronic device includes a lens, an image sensor, and an electronic device of a motor, the method comprising: In response to a first event, the first event is used to indicate focus, determining that the image sensor is not being exposed, and driving the motor to move to change the distance between the lens and the image sensor for focusing; In response to the first event, it is determined that the image sensor is being exposed. After the exposure of the image sensor is completed, the motor is driven to move to change the distance between the lens and the image sensor for focusing.

2. The method according to claim 1, characterized in that The first event includes that the clarity of the captured image is lower than a clarity threshold, or the first event includes receiving a focus request from a user.

3. The method according to claim 1 or 2, characterized in that If the level of the first pin of the image sensor is the first level, it is determined that the image sensor is being exposed; If the level of the first pin of the image sensor is the second level, it is determined that the image sensor is not being exposed.

4. The method according to claim 3, characterized in that The electronic device further includes: a processor and a first focus chip; the first focus chip is used to drive the motor to move, the processor is connected to the first focus chip, and the processor is connected to the first pin of the image sensor; The determining that the image sensor is not being exposed and driving the motor to move includes: When the processor detects that the level of the first pin is the second level, it sends a focus signal to the first focus chip, where the focus signal is used to trigger focus; The first focus chip drives the motor to move in response to the focus signal; The determining that the image sensor is being exposed and then driving the motor to move after the exposure of the image sensor is completed includes: The processor detects that the level of the first pin is the first level, and then drives the motor to move after the processor detects that the level of the first pin changes to the second level.

5. The method according to claim 3, characterized in that The electronic device further includes: a processor and a second focus chip; the second focus chip is used to store a focus signal and drive the motor to move, the focus signal is used to trigger focus, the second focus chip is connected to the motor and the processor, and the second focus chip is connected to the first pin of the image sensor; In response to the first event, determining that the image sensor is not being exposed and driving the motor to move; in response to the first event, determining that the image sensor is being exposed and driving the motor to move after the exposure of the image sensor ends, including: In response to the first event, the processor sends the focus signal to the second focus chip; The second focus chip stores the focus signal; The second focus chip detects that the level of the first pin is the second level, and the second focus chip drives the motor to move based on the stored focus signal; The second focus chip detects that the level of the first pin is the first level, and then drives the motor to move after the second focus chip detects that the level of the first pin changes to the second level.

6. The method according to claim 3, characterized in that The electronic device further includes: a processor, a first focus chip, and a switch module; the switch module is used to store and control focus signal transmission, the focus signal is used to trigger focus, the first focus chip is used to drive the motor to move, the switch module is connected to the first focus chip and the processor, and the switch module is connected to the first pin of the image sensor; In response to the first event, determining that the image sensor is not being exposed and driving the motor to move; in response to the first event, determining that the image sensor is being exposed and driving the motor to move after the exposure of the image sensor ends, including: In response to the first event, the processor sends the focus signal to the switch module; The switch module stores the focus signal; The switch module detects that the level of the first pin is the second level, and sends the stored focus signal to the first focus chip; The switch module detects that the level of the first pin is the first level, and then sends the stored focus signal to the first focus chip after the switch module detects that the level of the first pin changes to the second level; The first focus chip drives the motor to move in response to the focus signal.

7. The method according to any one of claims 4 to 6, characterized in that Driving the motor to move includes: driving the motor to move in a first direction; The first direction is a direction along the optical axis of the lens and close to the image sensor; or the first direction is a direction along the optical axis of the lens and away from the image sensor.

8. An electronic device, characterized in that: The electronic device includes a lens, an image sensor, a motor, a processor, and a memory; the lens is used to transmit light from the object to be photographed to the image sensor, the image sensor is used to convert the optical signal corresponding to the light into an electrical signal for exposure, the motor is used to drive the lens to move for focusing, and the memory stores computer instructions; When the processor executes the computer instructions, the electronic device is caused to perform the method according to any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that The method comprises computer instructions, which, when executed on an electronic device, enable the electronic device to execute the method according to any one of claims 1 to 7.

10. A chip system, characterized in that: The chip system includes an interface circuit and a processor; the interface circuit and the processor are interconnected via lines; the interface circuit is used to receive signals from a memory and send signals to the processor, the signals including computer instructions stored in the memory; when the processor executes the computer instructions, the chip system executes the method as described in any one of claims 1 to 7.