Zoom method and device

By dividing the lens's working range into multiple sub-ranges and combining the configuration parameters of the position detection and analog-to-digital conversion modules, the problem of focusing inaccuracy when the camera module is zooming is solved, achieving higher zoom accuracy and stability.

CN114079708BActive Publication Date: 2025-09-12HUAWEI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202010754835.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-30
Publication Date
2025-09-12
Estimated Expiration
2040-07-30

AI Technical Summary

Technical Problem

Existing camera modules are easily affected by environmental interference when zooming, causing the lens to deviate from the target position, affecting focusing accuracy and shooting quality.

Method used

The working range of the lens is divided into multiple sub-ranges, and the position of the lens in each sub-range is detected by the position detection module. The sub-range specific position detection relationship and the configuration parameters of the analog-to-digital conversion module are used to accurately control the movement of the lens to the target focal length.

Benefits of technology

The accuracy and stability of the camera module's zoom are improved, the error in lens position detection is reduced, and the lens can be stopped at the target position more accurately, thereby improving the clarity of the captured image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114079708B_ABST
    Figure CN114079708B_ABST
Patent Text Reader

Abstract

A zoom method and device for improving the accuracy of camera module zoom. The method includes: when controlling the movement of the lens in the working range according to the target focal length, controlling the movement of the lens in different sub-ranges, and using the position detection relationship of the sub-range in which the lens is currently located to determine the position information of the lens. By controlling the movement of the lens using the position of the lens detected during the movement of the lens, the lens can be more accurately stopped at the position corresponding to the target focal length, which helps to improve the accuracy of the camera module focus. Moreover, when the range of the digital signal output by the position detection module is consistent, the position movement of the lens represented by each digital signal output by the position detection module in each sub-range is smaller than the position movement in the entire working range, so that the position change of the lens can be detected from a finer granularity, further improving the accuracy of the camera module zoom.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of optical zoom technology, and in particular to a zoom method and device. Background Art

[0002] Electronic devices with camera functions are becoming increasingly common. The zoom function of the camera module in these electronic devices is a key factor affecting photo quality. To capture clear images, the camera module must have good zoom capabilities.

[0003] In order to achieve a better zoom function, more and more camera modules support optical zoom. Optical zoom can change the focal length by moving the position of the lens in the camera module, thereby magnifying the subject while ensuring that the image resolution and image quality of the subject do not change, making the subject image clearer. However, when zooming, existing camera modules usually directly determine the fixed drive mode of the lens based on the target focal length, and then drive the lens to stop at the position corresponding to the target focal length according to this fixed drive mode. However, this method is often affected by environmental interference, such as vibration of the camera module. In this case, the position where the lens finally stops may deviate far from the target position, resulting in reduced accuracy of the camera module's focus, and the pictures taken by the camera module will not meet the needs of users.

[0004] Based on this, there is an urgent need for a zoom method to improve the focusing accuracy of the camera module. Summary of the Invention

[0005] The present application provides a zoom method and device for improving the zoom accuracy of a camera module.

[0006] In a first aspect, the present application provides a zoom method, which is applied to a camera module, which includes a lens, a drive component, a position detection module and a controller. The method is executed by the controller, and the method includes: the controller obtains a target focal length, and when the drive component is controlled to drive the lens to move within the working range according to the target focal length, the lens is controlled to move in different sub-ranges. When the lens moves in each sub-range, the controller can use the position detection relationship of the sub-range in which the lens is currently located to determine the position information of the lens. The working range may include N sub-ranges, N is an integer greater than or equal to 2, and each sub-range is smaller than the working area. Each sub-range corresponds to a position detection relationship, which is used to define the ability of each digital signal output by the position detection module to represent the movement distance of the lens in the sub-range.

[0007] In the above design, by continuously detecting the position of the lens during its movement and controlling the movement of the lens in different sub-intervals based on the position of the lens, the lens can be more accurately stopped at the position corresponding to the target focal length, which helps to improve the accuracy of the camera module focus. Furthermore, by dividing the working interval of the lens into at least two sub-intervals, each sub-interval can be smaller than the working interval. In this way, when the range of the digital signal output by the position detection module is consistent, the position movement amount (i.e., the movement distance) of the lens represented by each digital signal output by the position detection module in each sub-interval is smaller than the position movement amount in the entire working interval, so that the controller can detect the position change of the lens from a finer granularity, and the accuracy of the lens position detection is improved. Controlling the movement of the lens based on a more precise position can also further improve the accuracy of the camera module zoom.

[0008] In one optional design, the N subintervals may include a first subinterval and a second subinterval, the first subinterval and the second subinterval being adjacent and having an overlapping area. When the controller controls the drive assembly to drive the lens from the first subinterval to the second subinterval, before the lens moves to a preset position in the overlapping area, the controller determines the first subinterval as the subinterval in which the lens is currently located. After the lens moves to the preset position in the overlapping area, the controller determines the second subinterval as the subinterval in which the lens is currently located. In this design, the preset position is equivalent to the switching point between the two subintervals. At the switching point, the controller switches to using the position detection relationship of the other subinterval to detect the position of the lens. This approach enables seamless connection of lens position detection between the two subintervals, helping to improve the continuity of controlling lens movement.

[0009] In one optional design, the preset position can be the end position of the overlapping area, and the lens moves out of the overlapping area at the end position. This design is suitable for scenarios where the lens reciprocates near the overlapping area. Because switching the position detection relationship often causes electrical signal jumps, which is not conducive to zoom stability, switching the position detection relationship only when the lens actually moves out of the overlapping area can reduce the number of position detection relationship switches, reduce the number of electrical signal jumps, and improve zoom stability.

[0010] In an optional design, the controller controls the movement of the lens in different sub-intervals according to the target focal length, including: the controller first determines the target position information of the lens according to the target focal length; if the first position information of the current position of the lens does not match the target position information, then inputs a first electrical signal to the drive component according to the first position information and the target position information, so that the drive component drives the lens to move; and then uses the position detection relationship of the sub-interval where the lens is located after the movement to determine the second position information after the movement of the lens; if the second position information still does not match the target position information, then inputs a second electrical signal to the drive component according to the second position information and the target position information, so that the drive component drives the lens to continue moving; if the second position information matches the target position information, the movement of the lens is stopped. In this design, by continuously detecting the current position of the lens during the movement of the lens and adjusting the electrical signal of the drive component according to the position, it helps to drive the lens to stop at the target position more accurately, thereby improving the focusing accuracy of the camera module.

[0011] In an optional design, the position detection module may include a Hall sensor module and an analog-to-digital conversion module, and the position detection relationship of each sub-interval includes the configuration parameters of the analog-to-digital conversion module corresponding to the sub-interval, and the correspondence between the digital signal output by the analog-to-digital conversion module corresponding to the sub-interval and the position information of the lens. In this case, the controller uses the position detection relationship of the sub-interval in which the lens is located after movement to determine the second position information of the lens after movement, including: the controller first determines the target sub-interval in which the lens is located after movement based on the position indication information of the lens detected by the Hall sensor module and the preset correspondence between the position indication information and the sub-interval, then processes the position indication information using the first configuration parameters of the analog-to-digital conversion module corresponding to the target sub-interval through the analog-to-digital conversion module, outputs a first digital signal, and determines the second position information corresponding to the first digital signal based on the correspondence between the digital signal output by the analog-to-digital conversion module corresponding to the target sub-interval and the position information of the lens. The position indication information is used to indicate the position information of the lens after movement.

[0012] In this design, by setting the correspondence between preset position indication information and sub-intervals, the configuration parameters corresponding to each sub-interval, and the correspondence between the digital signal output by the analog-to-digital conversion module corresponding to each sub-interval and the position information of the lens, the controller can first directly query the correspondence between the preset position indication information and the sub-interval according to the position indication information corresponding to the current position of the lens to determine the sub-interval where the lens is located, and then, with the support of the configuration parameters corresponding to the sub-interval, query the correspondence between the digital signal output by the analog-to-digital conversion module corresponding to the sub-interval and the position information of the lens to determine the position information of the lens in the sub-interval. The querying correspondence method helps to detect the position of the lens more quickly and improve the focusing efficiency of the camera module.

[0013] In an alternative design, the drive assembly may include a motor, and the Hall sensor module may include a Hall magnet and a Hall coil, wherein the Hall magnet is fixedly connected to the lens. In this case, the position indication information may be an electrical signal output by the Hall coil. The controller drives the lens to move via the drive assembly, specifically by driving the lens and Hall magnet via the motor. When the Hall magnet moves, the Hall coil outputs a third electrical signal to the analog-to-digital conversion module. The controller can then determine the target subinterval corresponding to the third electrical signal based on a preset correspondence between the electrical signal output by the Hall coil and the subinterval in which the lens is located. In this design, by pre-storing a preset correspondence between the electrical signal output by the Hall coil and the subinterval in which the lens is located, the controller can directly query the target subinterval in which the lens is located based on this correspondence, facilitating faster detection of the lens' current position. Furthermore, the Hall sensor has a simple structure, a small size, and can quickly respond to position changes. Therefore, using the Hall sensor for position detection can save costs, reduce the size of the camera module, and improve the efficiency of position detection.

[0014] In an optional design, the analog-to-digital conversion module may include a primary amplifier, a secondary amplifier, a bias device, and an analog-to-digital converter. The input of the primary amplifier is connected to the Hall coil, the output of the primary amplifier is connected to the input of the secondary amplifier, the output of the secondary amplifier is connected to the input of the bias device, and the output of the bias device is connected to the input of the analog-to-digital converter. In this case, the first configuration parameter may include the amplification factor of the primary amplifier, the amplification factor of the secondary amplifier, and the bias factor of the bias device. When the controller processes the position indication information using the first configuration parameter of the analog-to-digital conversion module corresponding to the target sub-interval through the analog-to-digital conversion module and outputs the first digital signal, it may specifically be that the third electrical signal is processed by the primary amplifier, the secondary amplifier, and the bias device, and the first digital signal is output through the analog-to-digital converter. In this design, the controller can amplify and / or bias the third electrical signal output by the Hall coil through the analog-to-digital conversion module, and this adjustment can keep the third electrical signal within a reasonable range, facilitating position detection and mobile drive during focusing. Moreover, since the controller can adjust each time based on the configuration parameters corresponding to the sub-interval where the lens is currently located, even if there are overlapping areas between the sub-intervals, the adjusted digital signal can accurately match the sub-interval where the lens is currently located, which helps to improve the accuracy of lens positioning.

[0015] In an optional design, the N subintervals may include a first subinterval and a second subinterval, wherein the first subinterval and the second subinterval are adjacent and have an overlapping area. In this case, the controller determines the subinterval in which the lens is currently located based on the lens position indication information detected by the Hall sensor module and the preset correspondence between the position indication information and the subintervals. This includes: when the lens position indication information detected by the Hall sensor module matches the position indication information corresponding to the first subinterval, the controller may determine that the target subinterval in which the lens is located after movement is the first subinterval, wherein the position indication information corresponding to the first subinterval includes the lens position indication information detected by the Hall sensor module when the lens is located at any position between the first endpoint of the first subinterval and a preset position, and the first endpoint is not within the overlapping area. When the lens position indication information detected by the Hall sensor module matches the position indication information corresponding to the second subinterval, the controller may determine that the target subinterval in which the lens is located after movement is the second subinterval, wherein the position indication information corresponding to the second subinterval includes the lens position indication information detected by the Hall sensor module when the lens is located at any position between the preset position and the second endpoint of the second subinterval, and the second endpoint is not within the overlapping area. The preset position may be a position within the overlapping area. In this design, by pre-storing the endpoint positions and preset positions of each sub-interval, and the correspondence between the electrical signals output by the Hall coil at these positions, even if the lens is located in the overlapping area of ​​two sub-intervals, causing the electrical signals output by the Hall coil to correspond to two positions in the two sub-intervals, the controller can use the position of the lens in the sub-interval where it is currently located as the current position of the lens, thereby helping to improve the accuracy of detecting the lens position in the overlapping area.

[0016] In an optional design, the N subranges may include a third subrange and a fourth subrange, the third subrange including a third endpoint and a fourth endpoint, and the fourth subrange including a fifth endpoint and a sixth endpoint. In this case, before determining the target position information of the lens based on the target focal length, the controller further controls the lens to move within the third and fourth subranges. When the lens is at the third endpoint, the analog-to-digital conversion module processes the fourth electrical signal using the second configuration parameters to output a second digital signal. When the lens is at the fourth endpoint, the analog-to-digital conversion module processes the fifth electrical signal using the second configuration parameters to output a third digital signal. When the lens is at the fifth endpoint, the analog-to-digital conversion module processes the sixth electrical signal using the third configuration parameters to output a fourth digital signal. When the lens is at the sixth endpoint, the analog-to-digital conversion module processes the seventh electrical signal using the third configuration parameters to output a fifth digital signal. The difference between the second and third digital signals is a first difference, and the difference between the fourth and fifth digital signals is a second difference. The absolute value of the first difference and the absolute value of the second difference are not less than the difference within the preset digital signal range.

[0017] In this design, the controller can use the difference of the preset digital signal range to verify each sub-interval before focusing, wherein the difference of the preset digital signal range can be a preset position movement amount corresponding to the required position detection accuracy. In this case, since the position movement amount of the lens represented by each digital electrical signal output by the analog-to-digital conversion module in a certain sub-interval is proportional to the ratio of the length of the two ends of the sub-interval and the difference between the digital electrical signals output by the analog-to-digital conversion module at the two ends of the sub-interval, the position movement amount of the lens represented by each digital electrical signal output by the analog-to-digital conversion module in each sub-interval is adjusted to be no less than the difference of the preset digital signal range, so that the position movement amount of the lens represented by each digital electrical signal output by the analog-to-digital conversion module in each sub-interval can be no greater than the preset position movement amount. This method can make the position detection accuracy of the lens greater than the required position detection accuracy, and the larger the difference of the preset digital signal range, the higher the position detection accuracy of the lens.

[0018] In one optional design, the correspondence between the digital signal output by the analog-to-digital conversion module corresponding to the third subinterval and the lens position information includes the following features: the second digital signal corresponds to the position information of the third endpoint, and the third digital signal corresponds to the position information of the fourth endpoint. Correspondingly, the correspondence between the digital signal output by the analog-to-digital conversion module corresponding to the fourth subinterval and the lens position information includes the following features: the fourth digital signal corresponds to the position information of the fifth endpoint, and the fifth digital signal corresponds to the position information of the sixth endpoint. In this design, the controller can determine the correspondence between any position and the digital signal in each subinterval based on the positions of the two endpoints of each subinterval and the digital signals corresponding to the two endpoints. Thus, when focusing, the controller can query this correspondence based on the digital signal corresponding to the current position of the lens, thereby accurately determining the position of the lens in the current subinterval.

[0019] In an optional design, the union of the N sub-intervals is not less than the working range of the lens. In this way, the N sub-intervals can cover the entire working range, so that no matter where the lens moves to in the working range, it can be accurately detected by the controller.

[0020] In a second aspect, the present application provides a camera module, which may include a lens, a drive component, a position detection module, a controller and a memory, wherein the controller is connected to the drive component and the position detection module respectively. One or more computer programs are stored in the memory, and the one or more computer programs include instructions. When the instructions are called and executed by the controller, the controller executes the following method: obtaining a target focal length, and sending control information to the drive component according to the target focal length, so that the drive component drives the lens to move within a working interval under the control of the control information; wherein the working interval includes N subintervals, N is an integer greater than or equal to 2, and each subinterval is smaller than the working area; each subinterval corresponds to a position detection relationship, and the position detection relationship is used to define the ability of each digital signal output by the position detection module to represent the movement distance of the lens in the subinterval. In this case, the controller can also use the position detection relationship of the subinterval in which the lens is currently located to determine the position information of the lens when the lens moves in each subinterval.

[0021] In one optional design, the N subintervals may include a first subinterval and a second subinterval, where the first subinterval and the second subinterval are adjacent and have an overlapping area. In this case, the drive assembly may be driven to move from the first subinterval to the second subinterval under the control of the control information. The controller may determine that the first subinterval is the subinterval in which the lens is currently located before the lens moves to a preset position in the overlapping area, and may determine that the second subinterval is the subinterval in which the lens is currently located after the lens moves to the preset position in the overlapping area.

[0022] In an optional design, the preset position is the end position of the overlapping area, and the lens moves out of the overlapping area at the end position.

[0023] In an optional design, the controller can determine the target position information of the lens based on the target focal length. When the first position information of the current position of the lens does not match the target position information, the first electrical signal is input to the driving component based on the first position information and the target position information, so that the driving component uses the first electrical signal to drive the lens to move. The controller can also use the position detection relationship of the sub-interval where the lens is located after moving to determine the second position information after the lens moves. When the second position information does not match the target position information, the second electrical signal is input to the driving component based on the second position information and the target position information, so that the driving component uses the second electrical signal to drive the lens to continue moving. When the second position information matches the target position information, a stop drive signal is sent to the driving component to cause the driving component to stop driving the movement of the lens.

[0024] In an optional design, the position detection module may include a Hall sensor module and an analog-to-digital conversion module, and the controller is connected to the Hall sensor module and the analog-to-digital conversion module, respectively. In this design, the position detection relationship for each sub-interval includes the configuration parameters of the analog-to-digital conversion module corresponding to the sub-interval, and the correspondence between the digital signal output by the analog-to-digital conversion module corresponding to the sub-interval and the position information of the lens. In this case, when the driving component uses the first electrical signal to drive the lens to move, the controller can also obtain the position indication information of the lens detected by the Hall sensor module. Based on the position indication information and the preset correspondence between the position indication information and the sub-interval, the controller determines the target sub-interval where the lens is located after movement. The controller then sends the first configuration parameters of the analog-to-digital conversion module corresponding to the target sub-interval to the analog-to-digital conversion module, so that the analog-to-digital conversion module processes the position indication information using the first configuration parameters of the analog-to-digital conversion module corresponding to the target sub-interval and outputs a first digital signal. The controller can also obtain the first digital signal and determine the second position information corresponding to the first digital signal based on the correspondence between the digital signal output by the analog-to-digital conversion module corresponding to the target sub-interval and the position information of the lens. The position indication information is used to indicate the position information of the lens after movement.

[0025] In an optional design, the drive assembly may include a motor, and the Hall sensor module may include a Hall magnet and a Hall coil, with the Hall magnet fixedly connected to the lens. In this case, the drive assembly can drive the lens and the Hall magnet to move via the motor. When the Hall magnet moves, the Hall coil can output a third electrical signal to the analog-to-digital conversion module, causing the analog-to-digital conversion module to process the third electrical signal using the first configuration parameters of the analog-to-digital conversion module corresponding to the target sub-interval and output a first digital signal. The controller can also obtain the third electrical signal and determine the target sub-interval corresponding to the third electrical signal based on a preset correspondence between the electrical signal output by the Hall coil and the sub-interval in which the lens is located.

[0026] In an optional design, the analog-to-digital conversion module may include: a first-stage amplifier, a second-stage amplifier, a bias device, and an analog-to-digital converter, wherein the input of the first-stage amplifier is connected to the Hall coil, the output of the first-stage amplifier is connected to the input of the second-stage amplifier, the output of the second-stage amplifier is connected to the input of the bias device, and the output of the bias device is connected to the input of the analog-to-digital converter. In this case, the first configuration parameter may include: an amplification factor of the first-stage amplifier, an amplification factor of the second-stage amplifier, and a bias factor of the bias device. The analog-to-digital conversion module may process the third electrical signal through the first-stage amplifier, the second-stage amplifier, and the bias device, and output a first digital signal.

[0027] In an optional design, the N subintervals may include a first subinterval and a second subinterval, wherein the first subinterval and the second subinterval are adjacent and have an overlapping area. In this case, the controller may further obtain position indication information of the lens detected by the Hall sensor module. When the position indication information matches the position indication information corresponding to the first subinterval, the target subinterval is determined to be the first subinterval, wherein the position indication information corresponding to the first subinterval includes the position indication information of the lens detected by the Hall sensor module when the lens is located at any position between the first endpoint of the first subinterval and a preset position, and the first endpoint is not within the overlapping area. When the position indication information matches the position indication information corresponding to the second subinterval, the target subinterval is determined to be the second subinterval, wherein the position indication information corresponding to the second subinterval includes the position indication information of the lens detected by the Hall sensor module when the lens is located at any position between the preset position and the second endpoint of the second subinterval, and the second endpoint is not within the overlapping area. The preset position is a position within the overlapping area.

[0028] In an optional design, the N subranges may include a third subrange and a fourth subrange, the third subrange including a third endpoint and a fourth endpoint, and the fourth subrange including a fifth endpoint and a sixth endpoint. Before determining the target position information of the lens based on the target focal length, the controller may further send calibration control information to the drive assembly, causing the drive assembly to drive the lens between the third subrange and the fourth subrange under the control of the calibration control information. When the lens moves within the third subrange, the controller may input second configuration parameters to the analog-to-digital conversion module, causing the analog-to-digital conversion module to process a fourth electrical signal using the second configuration parameters and output a second digital signal when the lens is at the third endpoint, and to process a fifth electrical signal using the second configuration parameters and output a third digital signal when the lens is at the fourth endpoint. The controller is further configured to: when the lens moves within the fourth subrange, input third configuration parameters to the analog-to-digital conversion module, causing the analog-to-digital conversion module to process a sixth electrical signal using the third configuration parameters and output a fourth digital signal when the lens is at the fifth endpoint, and to process a seventh electrical signal using the third configuration parameters and output a fifth digital signal when the lens is at the sixth endpoint. Among them, the absolute value of the first difference and the absolute value of the second difference are not less than the difference of the preset digital signal range; the first difference is the difference between the second digital signal and the third digital signal; the second difference is the difference between the fourth digital signal and the fifth digital signal.

[0029] In an optional design, the controller may further establish a correspondence between the digital signal output by the analog-to-digital conversion module corresponding to the third subinterval and the lens position information, and a correspondence between the digital signal output by the analog-to-digital conversion module corresponding to the fourth subinterval and the lens position information. The correspondence between the digital signal output by the analog-to-digital conversion module corresponding to the third subinterval and the lens position information includes the following features: the second digital signal corresponds to the position information of the third endpoint, and the third digital signal corresponds to the position information of the fourth endpoint. The correspondence between the digital signal output by the analog-to-digital conversion module corresponding to the fourth subinterval and the lens position information includes the following features: the fourth digital signal corresponds to the position information of the fifth endpoint, and the fifth digital signal corresponds to the position information of the sixth endpoint.

[0030] In an optional design, the union of the N sub-intervals is not smaller than the working interval of the lens.

[0031] In a third aspect, the present application provides an electronic device comprising a processor and a camera module as described in any one of the second aspects above, wherein the processor is configured to control the camera module. For example, the processor may generate processing instructions in response to a user's shooting operation and send the processing instructions to the camera module to cause the camera module to perform various operations (such as moving the lens for focusing, outputting data from a photosensitive element to the processor, etc.).

[0032] In a fourth aspect, the present application provides a controller, which is located in a camera module, and the camera module also includes a lens, a drive component, and a position detection module. The controller includes an acquisition unit, a control unit, and a detection unit:

[0033] An acquisition unit, used for acquiring a target focal length;

[0034] A control unit, configured to control the movement of the lens within different subranges according to a target focal length; wherein the working range includes N subranges, where N is an integer greater than or equal to 2, each subrange is smaller than the working area, and each subrange corresponds to a position detection relationship, which defines the ability of each digital signal output by the position detection module to represent the movement distance of the lens within the subrange;

[0035] The detection unit is configured to determine the position information of the lens by using the position detection relationship of the sub-interval in which the lens is currently located when the lens moves in each sub-interval.

[0036] In an optional embodiment, the N subintervals may include a first subinterval and a second subinterval, where the first subinterval and the second subinterval are adjacent and have an overlapping area. The control unit is further configured to: before the lens moves to a preset position in the overlapping area, determine the first subinterval as the subinterval in which the lens is currently located; and after the lens moves to the preset position in the overlapping area, determine the second subinterval as the subinterval in which the lens is currently located.

[0037] In an optional embodiment, the preset position is the end position of the overlapping area, and the lens moves out of the overlapping area at the end position.

[0038] In an optional embodiment, the control unit is specifically configured to determine target position information of the lens based on the target focal length, and when the first position information of the current position of the lens does not match the target position information, input a first electrical signal to the drive assembly based on the first position information and the target position information, so that the drive assembly drives the lens to move. The detection unit is specifically configured to determine second position information of the lens after movement using a position detection relationship of the subinterval in which the lens is located after movement. The control unit is further configured to input a second electrical signal to the drive assembly based on the second position information and the target position information, so that the drive assembly drives the lens to continue moving, when the second position information does not match the target position information, and stop driving the lens to move when the second position information matches the target position information.

[0039] In an optional embodiment, the position detection module may include a Hall sensor module and an analog-to-digital conversion module, and the position detection relationship for each sub-interval includes the configuration parameters of the analog-to-digital conversion module corresponding to the sub-interval, and the correspondence between the digital signal output by the analog-to-digital conversion module corresponding to the sub-interval and the position information of the lens. In this case, the detection unit is specifically configured to: first determine the target sub-interval where the lens is located after movement based on the position indication information of the lens detected by the Hall sensor module and the preset correspondence between the position indication information and the sub-interval; then, process the position indication information using the first configuration parameters of the analog-to-digital conversion module corresponding to the target sub-interval through the analog-to-digital conversion module to output a first digital signal; and then, determine second position information corresponding to the first digital signal based on the correspondence between the digital signal output by the analog-to-digital conversion module corresponding to the target sub-interval and the position information of the lens. The position indication information is used to indicate the position information of the lens after movement.

[0040] In an optional embodiment, the drive assembly may include a motor, and the Hall sensor module may include a Hall magnet and a Hall coil, wherein the Hall magnet is fixedly connected to the lens. The position indication information may be an electrical signal output by the Hall coil. In this case, the control unit is specifically configured to: drive the lens and the Hall magnet to move via the motor. The detection unit is further configured to: when the Hall magnet moves, output a third electrical signal to the analog-to-digital conversion module via the Hall coil, and determine the target sub-interval corresponding to the third electrical signal based on a preset correspondence between the electrical signal output by the Hall coil and the sub-interval in which the lens is located.

[0041] In an optional embodiment, the analog-to-digital conversion module may include a first-stage amplifier, a second-stage amplifier, a bias device, and an analog-to-digital converter, wherein the input of the first-stage amplifier is connected to the Hall coil, the output of the first-stage amplifier is connected to the input of the second-stage amplifier, the output of the second-stage amplifier is connected to the input of the bias device, and the output of the bias device is connected to the input of the analog-to-digital converter. The first configuration parameter includes: an amplification factor of the first-stage amplifier, an amplification factor of the second-stage amplifier, and a bias factor of the bias device. In this case, the detection unit is specifically configured to process the third electrical signal via the first-stage amplifier, the second-stage amplifier, and the bias device, and output the first digital signal via the analog-to-digital converter.

[0042] In an optional embodiment, the N subintervals may include a first subinterval and a second subinterval, the first subinterval and the second subinterval being adjacent and having an overlapping area, and the detection unit is specifically configured to: when the position indication information of the lens detected by the Hall sensor module matches the position indication information corresponding to the first subinterval, determine that the target subinterval is the first subinterval, wherein the position indication information corresponding to the first subinterval includes the position indication information of the lens detected by the Hall sensor module when the lens is located at any position between the first endpoint and the preset position of the first subinterval, and the first endpoint is not within the overlapping area. When the position indication information of the lens detected by the Hall sensor module matches the position indication information corresponding to the second subinterval, determine that the target subinterval is the second subinterval, wherein the position indication information corresponding to the second subinterval includes the position indication information of the lens detected by the Hall sensor module when the lens is located at any position between the preset position and the second endpoint of the second subinterval, and the second endpoint is not within the overlapping area. The preset position is a position within the overlapping area.

[0043] In an optional embodiment, the N subranges may include a third subrange and a fourth subrange, the third subrange including a third endpoint and a fourth endpoint, and the fourth subrange including a fifth endpoint and a sixth endpoint. Before the detection unit determines the target position information of the lens based on the target focal length, the control unit is further configured to: control the drive assembly to drive the lens to move between the third subrange and the fourth subrange. The detection unit is further configured to: when the lens is at the third endpoint, process the fourth electrical signal using the second configuration parameters via the analog-to-digital conversion module to output a second digital signal; when the lens is at the fourth endpoint, process the fifth electrical signal using the second configuration parameters via the analog-to-digital conversion module to output a third digital signal; when the lens is at the fifth endpoint, process the sixth electrical signal using the third configuration parameters via the analog-to-digital conversion module to output a fourth digital signal; and when the lens is at the sixth endpoint, process the seventh electrical signal using the third configuration parameters via the analog-to-digital conversion module to output a fifth digital signal. The difference between the second digital signal and the third digital signal is a first difference, the difference between the fourth digital signal and the fifth digital signal is a second difference, and the absolute value of the first difference and the absolute value of the second difference are not less than the difference within a preset digital signal range.

[0044] In an optional embodiment, the correspondence between the digital signal output by the analog-to-digital conversion module and the lens position information in the third subinterval includes the following characteristics: the second digital signal corresponds to the position information of the third endpoint, and the third digital signal corresponds to the position information of the fourth endpoint. Correspondingly, the correspondence between the digital signal output by the analog-to-digital conversion module and the lens position information in the fourth subinterval includes the following characteristics: the fourth digital signal corresponds to the position information of the fifth endpoint, and the fifth digital signal corresponds to the position information of the sixth endpoint.

[0045] In an optional embodiment, the union of the N sub-intervals is not smaller than the working interval of the lens.

[0046] In a fifth aspect, the present application also provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called by a computer, the computer executes any possible design method of any of the above aspects.

[0047] In a sixth aspect, the present application also provides a method comprising a computer program product, which, when the computer program product is run on a terminal, enables the electronic device to execute any possible design of any of the above aspects. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1A A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0049] Figure 1BA schematic structural diagram of a camera module provided in an embodiment of the present application;

[0050] Figure 2 A schematic diagram illustrating a circuit structure of a camera module provided in an embodiment of the present application is exemplified;

[0051] Figure 3 The following is a flow chart showing a zoom method according to an embodiment of the present application;

[0052] Figure 4 A schematic diagram of an operation interface for a sliding touch operation is shown as an example;

[0053] Figure 5 A diagram exemplarily shows a corresponding relationship between the electrical signal output by a preset Hall coil and the sub-interval where the lens is located;

[0054] Figure 6 A diagram exemplarily shows the corresponding relationship between the electrical signal output by another preset Hall coil and the sub-interval where the lens is located;

[0055] Figure 7 A schematic diagram exemplarily shows a correspondence between a digital signal output by a preset analog-to-digital conversion module and position information of a lens;

[0056] Figure 8 A schematic diagram exemplarily shows the correspondence between the digital signal output by another preset analog-to-digital conversion module and the position information of the lens;

[0057] Figure 9 A schematic diagram illustrating a flow chart corresponding to a calibration method provided in an embodiment of the present application is exemplified;

[0058] Figure 10 A diagram exemplarily shows a corresponding relationship between an analog voltage signal received by an ADC and the position of a lens;

[0059] Figure 11 A schematic diagram exemplarily shows a method of detecting whether a configuration parameter of an analog-to-digital conversion module is switched by a secondary amplifier;

[0060] Figure 12 A structural diagram of a camera module provided in an embodiment of the present application is exemplarily shown. DETAILED DESCRIPTION

[0061] The various embodiments disclosed in this application can be applied to electronic devices with shooting functions. Among them, the electronic device in the embodiments of this application can be a device that only has a camera function, such as a camera. Alternatively, the electronic device in the embodiments of this application can also be a device that has a camera function and other functions, for example, it can be a portable electronic device that includes functions such as a personal digital assistant and / or a music player, such as a mobile phone, a tablet computer, a wearable device with wireless communication function (such as a smart watch), a car-mounted device, etc. Exemplary embodiments of portable electronic devices include but are not limited to devices equipped with Or a portable electronic device with other operating systems. The portable electronic device may also be a laptop computer with a camera (e.g., a camera). It should also be understood that in some other embodiments of the present application, the electronic device may also be a desktop computer with a camera (e.g., a camera).

[0062] Figure 1A A structural diagram of an electronic device 100 is exemplarily shown.

[0063] It should be understood that the illustrated electronic device 100 is merely an example, and that the electronic device 100 may have more or fewer components than shown, may combine two or more components, or may have a different component configuration. The various components shown in the figures may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application specific integrated circuits.

[0064] like Figure 1AAs shown, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, 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. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0065] The following combination Figure 1A The various components of the electronic device 100 are described in detail:

[0066] 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). Among them, different processing units can be independent devices or integrated into one or more processors. Among them, the controller can be the nerve center and command center of the electronic device 100. The controller can generate an operation control signal based on the instruction opcode and the timing signal to complete the control of instruction fetching and execution.

[0067] Processor 110 may also include a memory for storing instructions and data. In some embodiments, 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 same instruction or data again, it can directly access the memory, thereby avoiding repeated accesses and reducing processor 110 latency, thereby improving system efficiency.

[0068] The processor 110 can execute the zoom method provided in the embodiments of the present application. The processor can respond to a zoom operation (e.g., a touch zoom operation, a remote control zoom operation, a button zoom operation, etc.) and control the camera 193 to move to a position corresponding to the target focal length according to the zoom operation. When the processor 110 integrates different devices, such as a CPU and a GPU, the CPU and GPU can cooperate to execute the zoom method provided in the embodiments of the present application. For example, the algorithm for controlling the movement of the camera 193 in the zoom method is executed by the CPU, while the algorithm for detecting the zoom operation is executed by the GPU, thereby achieving faster processing efficiency.

[0069] In some embodiments, the processor 110 may include one or more interfaces. For example, the interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.

[0070] The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple I2C bus lines. The processor 110 may be coupled to the distance sensor 180F, the charger, the flash, the camera 193, and the like via different I2C bus interfaces. For example, the processor 110 may be coupled to the distance sensor 180F and the camera 193 via the I2C interface, enabling communication between the processor 110, the distance sensor 180F, and the camera 193 via the I2C bus interface, thereby implementing a zoom function for the electronic device 100.

[0071] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display 194 and the camera 193. MIPI interfaces include the camera serial interface (CSI) and the display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the camera function of the electronic device 100.

[0072] The GPIO interface can be configured via software. The GPIO interface can be configured as either a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to the camera 193, display 194, wireless communication module 160, audio module 170, sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0073] It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.

[0074] 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.

[0075] The ISP processes data fed back by 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 passed to the ISP for processing and converted into a visible image. The ISP can also perform algorithmic optimization on image noise, brightness, and skin tone. It can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be located within camera 193.

[0076] The camera module 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 charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical 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 one or more camera modules 193.

[0077] In the electronic device 100, the camera module 193 may be connected to a processor, which is used to control the camera module 193. For example, when shooting is required, the processor may generate processing instructions in response to the user's shooting operation and send the processing instructions to the camera module to enable the camera module to perform various operations (such as moving the lens to focus, outputting data from the photosensitive element, etc.).

[0078] In one embodiment, the electronic device 100 may include multiple camera modules 193. The processor may first determine the target focal length of the electronic device according to the user's operation, and then determine the target focal length corresponding to each camera module 193 according to the target focal length of the electronic device, and send the target focal length corresponding to each camera module to each camera module 193. For example, one or more chips may be provided in each camera module 193. Each camera module 193 may receive data sent by the processor through one or more chips, and control the movement of the lens through the driving component to achieve the zoom function. The specific structure of the camera module 193 will be described in detail in Figure 2 I will introduce it here first, but I won’t explain it here.

[0079] 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.

[0080] The internal memory 121 can be used to store computer executable program codes, which include instructions. The internal memory 121 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 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. The processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the internal memory 121 and / or instructions stored in a memory provided in the processor.

[0081] The distance sensor 180F is used to measure distance. The electronic device 100 can measure distance using infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure distance to achieve fast focusing.

[0082] The touch sensor 180K is also called a "touch panel." The touch sensor 180K can be disposed on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen." The touch sensor 180K is used to detect touch operations applied thereto or in the vicinity thereof. The touch sensor can transmit the detected touch operations to the application processor to determine the type of touch event. Visual output related to the touch operations can be provided via the display screen 194. In other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, in a location different from that of the display screen 194.

[0083] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0084] although Figure 1A Not shown, the electronic device 100 may further include a Bluetooth device, a positioning device, a flashlight, a micro-projection device, a near field communication (NFC) device, etc., which are not described in detail here.

[0085] Figure 1B The structure diagram of a camera module 200 provided in an embodiment of the present application is shown as an example. The camera module 200 may correspond to Figure 1A A camera module 193 in the embodiment of the present invention can realize optical zoom. Figure 1B As shown, the camera module 200 may include a driving component 210, a lens 220, a position detection module 230, and a controller 240. During optical zooming, the controller 240 may generate control information based on the target focal length and send the control information to the driving component 210. The driving component 210 may drive the lens 220 to move along a set track under the control of the control information of the controller 240. The position detection module 230 may detect the position information of the lens 220 during its movement and send the position information to the controller 240. The controller 240 may then change the control information sent to the driving component 210 based on the position information to accurately control the lens 220 to stop at the position corresponding to the target focal length.

[0086] Below we first Figure 1B Taking the zoom scheme in the embodiment of the present application as an example, a brief introduction is given to the following: In the embodiment of the present application, the working range of the lens 220 is divided into N sub-ranges, and each sub-range is calibrated by the difference of the same preset digital signal range output by the position detection module 230 to obtain the position detection relationship corresponding to each sub-range. In this way, based on the position detection relationship, the difference of the preset digital signal range can be used to represent the length of each sub-range. Since the length of each sub-range is smaller than the length of the entire working range, the length represented by each digital signal output by the position detection module 230 becomes smaller compared to using the difference of the preset digital signal range to represent the length of the entire working range. In this case, every time the drive component 210 drives the lens to move a smaller distance, the digital signal output by the position detection module 230 will change. It can be seen that this implementation method enables the position detection module 230 to detect more fine-grained position changes of the lens, which helps to improve the accuracy of lens position detection.

[0087] In the embodiment of the present application, the structure of the drive component 210 and the structure of the position detection module 230 can have multiple possibilities. For example, in one case, the drive component 210 is a servo motor and the position detection module 230 is a photoelectric position sensor. In another case, the drive component 210 is an electromagnetic driver and the position detection module 230 is a magnetostrictive position sensor, and so on. Under different drive components 210 and position detection modules 230, the position detection relationship corresponding to each sub-interval is expressed in different forms. The following exemplifies a possible structure of the drive component 210 and the position detection module 230, and uses this structure as an example to describe the specific implementation process of the zoom method in the embodiment of the present application.

[0088] Figure 2 The circuit structure diagram of a camera module 300 provided in an embodiment of the present application is exemplarily shown, wherein the camera module 300 can be the above-mentioned Figure 1A Camera module 193 or Figure 1B The camera module 200 in the optical zoom system may include a drive component, a lens 220, a position detection module, and a controller 240. The drive component may include a motor (including the motor coil 211 and the motor magnet 212 shown in the figure), the position detection module may include a Hall sensor module (including the Hall coil 231 and the Hall magnet 232 shown in the figure) and an analog-to-digital conversion module 250, and the analog-to-digital conversion module 250 includes an analog-to-digital converter (ADC). The motor coil 211 and the Hall coil 231 may be fixedly connected to the base of the camera module 300, and the motor magnet 212 and the Hall magnet 232 may be fixedly connected to the lens 220 of the camera module 300. The output end of the Hall coil 231 may be connected to the input end of the analog-to-digital conversion module 250, the output end of the analog-to-digital conversion module 250 may be connected to the input end of the controller 240, and the output end of the controller 240 may be connected to the motor coil 211. When the controller 240 applies a driving current to the motor coil 211, electromagnetic induction is generated between the motor magnet 212 and the motor coil 211, causing the motor magnet 212 to drive the lens 220 and the Hall magnet 232 to move. As the Hall magnet 232 moves, the magnetic field between the Hall magnet 232 and the Hall coil 231 changes. The Hall coil 231 senses this magnetic field change, generating a Hall potential difference across the two ends of the Hall coil 231 and outputting an analog voltage signal based on this Hall potential difference. This analog voltage signal is converted into a digital signal by the ADC in the analog-to-digital conversion module 250 and output to the controller 240. The controller 240 then determines the position of the lens after movement based on this digital signal.

[0089] In an embodiment of the present application, the ADC can perform the operation of converting an analog voltage signal into a digital signal according to a set sampling frequency. For example, when the sampling frequency is set to 1Kb / s (i.e., 1 kilobyte / second), the ADC can collect 1000 analog voltage signals per second and convert these 1000 analog voltage signals into digital signals. However, the voltage value of the analog voltage signal output by the Hall coil 231 is very small, usually only a few millivolts. Different analog voltage signals at this level are difficult to be converted into different digital signals by the ADC. In this case, an amplifier circuit can also be provided in the analog-to-digital conversion module 250, and the amplifier circuit is used to amplify the analog voltage signal output by the Hall coil 231. Exemplarily, the amplifier circuit can include a first-stage amplifier and a second-stage amplifier, the input end of the first-stage amplifier is connected to the output end of the Hall coil 231, the output end of the first-stage amplifier is connected to the input end of the second-stage amplifier, and the output end of the second-stage amplifier is used to connect to the input end of the ADC. Among them, the amplification factor of the first-stage amplifier is much larger than the amplification factor of the second-stage amplifier. For example, in a possible design, the amplification factor of the first-stage amplifier is 16K, K is a positive integer not greater than 6, and the amplification factor of the second-stage amplifier is a real number between 0 and 4, such as 2.12.

[0090] In one possible case, when the lens 220 moves from one position to another, the two analog voltage signals output by the Hall coil 231 for these two positions are amplified by the amplifier circuit. The two amplified analog voltage signals may exceed the limit range of the controller 240, causing interference to the subsequent driving process of the motor coil 211, affecting the accuracy of focusing. In order to solve this problem, a biaser can also be provided in the analog-to-digital conversion module 250, the input end of the biaser is connected to the output end of the secondary amplifier, and the output end of the biaser is connected to the input end of the ADC. The biaser is used to adjust the center point of the two analog voltage signals after amplification to the center point of the two analog voltage signals before amplification. In this way, after the two analog voltage signals adjusted by the biaser are converted into two digital signals by the ADC, the two digital signals can be within the limit range of the controller 240, thereby helping the controller 240 to accurately calculate the driving current applied to the motor coil 211 and improve the accuracy of focusing.

[0091] like Figure 2 As shown, the camera module 300 may further include a memory 260 and one or more computer programs. Among them, the one or more computer programs are stored in the memory 260, and the one or more computer programs include instructions. When the instructions are called and executed by the controller 240, the controller 240 executes the method described above.

[0092] In an embodiment of the present application, the controller 240, the analog-to-digital conversion module 250, and the memory 260 can be chips or circuits, such as chips or circuits that can be set in the camera module 300. When the controller 240, the analog-to-digital conversion module 250, and the memory 260 are chips, the controller 240, the analog-to-digital conversion module 250, and the memory 260 can be packaged in one chip or in multiple chips. When packaged in multiple chips, the controller 240, the analog-to-digital conversion module 250, and the memory 260 can be packaged in separate chips, or the controller 240 and the memory 260 can be packaged in one chip and the analog-to-digital conversion module 250 can be packaged in another chip. The controller 240 and the analog-to-digital conversion module 250 can also be packaged in one chip and the memory 260 can be packaged in another chip, and so on, which will not be introduced one by one. Of course, the most typical application at present is to package the controller 240, the analog-to-digital conversion module 250, and the memory 260 in one chip. The chip may be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a network processor (NP), a digital signal processor (DSP), a micro controller unit (MCU), a programmable logic device (PLD) or other integrated chips.

[0093] In an embodiment of the present application, the camera module 300 may further include a bus system and a communication interface, wherein the controller 240, the analog-to-digital conversion module 250, the memory 260, and the communication interface may be connected via the bus system. For example, when the controller 240, the analog-to-digital conversion module 250, and the memory 260 are packaged in a single chip, the chip may be mounted on a printed circuit board (PCB) and have a communication interface, and the chip may be connected to a processor (e.g., a central processing unit (CPU)) in the electronic device via a flexible printed circuit (FPC).

[0094] During implementation, each step of the above method can be completed by an integrated logic circuit of the hardware in the controller 240 or by instructions in the form of software. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as being executed by a hardware processor, or can be executed by a combination of hardware and software modules in the controller 240. The software module can be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 260, and the controller 240 reads the information in the memory 260 and completes the steps of the above method in conjunction with its hardware.

[0095] It should be noted that the controller 240 in the embodiments of the present application may also be an integrated circuit with signal processing capabilities. During implementation, each step of the above-described method embodiment may be completed by hardware integrated logic circuits or software instructions in the controller 240. The controller 240 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The methods, steps, and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of the present application may be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium mature in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in the memory, and the processor reads the information in the memory and, in conjunction with its hardware, completes the steps of the above-described method.

[0096] It is understood that the memory 260 in the embodiment of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus RAM (DR RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0097] The following is an introduction to the terms and technical solutions involved in the embodiments of this application.

[0098] (1) Mechanical range of the lens and the working range of the lens

[0099] In the embodiment of the present application, the mechanical range of the lens refers to the maximum movable range of the lens defined by the mechanical structure of the camera module, for example Figure 2 The working range of the lens refers to the movable range of the lens corresponding to the maximum zoom capability of the camera module, for example Figure 2 The interval L2 is shown. It can be seen that the mechanical interval of the lens is not less than the working interval of the lens (ie L1 ≥ L2).

[0100] For example, in order to ensure that the maximum zoom capability of the camera module can be fully realized, it is usually necessary to have a margin between the mechanical range of the lens and the working range of the lens, that is, the mechanical range of the lens is larger than the working range of the lens (ie L1>L2).

[0101] (2) Digital signal output by the analog-to-digital conversion module

[0102] In the embodiment of the present application, the digital signal output by the analog-to-digital conversion module is the digital signal output by the ADC, also known as the output code value (unit is code). The digital signal output by the ADC has a corresponding relationship with the analog signal received by the ADC. In the case where the ADC receives an analog voltage signal, assuming that the output digital signal range is 1code to 4096code, and the analog voltage signal range corresponding to the digital signal range is 0 to 50V (volts), then a digital signal output by the ADC can represent a voltage change of 50 / 4096V. In this case, if the analog voltage signal received by the ADC is between 0 and 50 / 4096V, the digital signal output by the ADC is 1code. If the analog voltage signal received by the ADC is between 50 / 4096V and 100 / 4096V, the digital signal output by the ADC is 2code, ..., if the analog voltage signal received by the ADC is between (50-50 / 4096)V and 50V, the digital signal output by the ADC is 4096code.

[0103] In the embodiment of the present application, the range of digital signals that the ADC can output is related to the number of detection bits of the ADC. For example, when the number of detection bits of the ADC is 10, the maximum value that the ADC can represent is 2 10 The number of detection bits of the ADC is 1024, which can be set arbitrarily. For example, in one subinterval, the digital signal output by the ADC ranges from 1 code to 1024 code, while in another subinterval, the digital signal output by the ADC can be from -1024 code to -1 code. For example, in the embodiment of the present application, the number of detection bits of the ADC can be 12 bits or 14 bits. When the number of detection bits of the ADC is 12 bits, the ADC can output a maximum of 4096 digital signals. When the number of detection bits of the ADC is 14 bits, the ADC can output a maximum of 16384 digital signals.

[0104] (3) Configuration parameters of the analog-to-digital conversion module

[0105] In an embodiment of the present application, the configuration parameters of the analog-to-digital conversion module may include one or more parameters selected from the group consisting of the amplification factor of the primary amplifier, the amplification factor of the secondary amplifier, and the bias factor of the bias breaker. Before the electronic device leaves the factory, the configuration parameters of the analog-to-digital conversion module in the camera module of the electronic device must be calibrated based on the difference within a preset digital signal range. Thus, after the electronic device leaves the factory, the controller in the camera module can adjust the amplification or bias of the analog voltage signal output by the Hall coil according to the calibrated configuration parameters.

[0106] (4) Resolution of the analog-to-digital conversion module

[0107] In the embodiments of the present application, the resolution of the analog-to-digital conversion module refers to its ability to detect changes in the position of the lens. When the position change of the lens exceeds the resolution of the analog-to-digital conversion module, the digital signal output by the analog-to-digital conversion module will change. In this case, a higher resolution of the analog-to-digital conversion module results in lower position detection accuracy, while a lower resolution of the analog-to-digital conversion module results in higher position detection accuracy.

[0108] In an optional embodiment, the resolution of the analog-to-digital conversion module can be expressed as the ratio of the difference between the movement range of the lens and the range of the digital signal output by the analog-to-digital conversion module. When the difference between the range of the digital signal output by the analog-to-digital conversion module is fixed, the larger the movement range of the lens, the greater the change in the movement of the lens represented by each digital signal output by the analog-to-digital conversion module. In this case, it is more difficult for the analog-to-digital conversion module to detect the movement of the lens, resulting in less accurate focus of the camera module. Correspondingly, the smaller the movement range of the lens, the smaller the change in the movement of the lens corresponding to each digital signal output by the analog-to-digital conversion module. In this case, it is easier for the analog-to-digital conversion module to detect the movement of the lens, thereby helping to improve the accuracy of the focus of the camera module.

[0109] However, current camera modules tend to feature higher-magnification optical zoom, which results in a gradually larger range of lens movement. In this case, if the hardware structure of the analog-to-digital conversion module is not changed, the lens position change represented by each digital signal output by the analog-to-digital conversion module will increase, making it more difficult for the camera module to detect lens position movement, and the accuracy of the camera module's zoom will also decrease. In summary, further research is needed to improve the accuracy of camera module zoom while achieving high-magnification zoom.

[0110] In an optional embodiment, the mechanical range of the lens can be used as the moving range of the lens. Although this method can achieve calibration by applying a large driving current to the motor to control the lens to move to the two ends of the mechanical range (the calibration operation is relatively simple), the mechanical range of the lens is usually set to a larger value (for example, much larger than the working range of the lens). Therefore, in this case, the resolution of the analog-to-digital conversion module is relatively high, resulting in lower detection accuracy of the lens position change, affecting the accuracy of the camera module zoom.

[0111] In order to solve this problem, in another optional embodiment, the moving range of the lens can be set to a value that is smaller than the mechanical range of the lens and not smaller than the working range of the lens. Since the working range of the lens is smaller than the mechanical range of the lens, compared with the previous solution, this method can reduce the resolution of the analog-to-digital conversion module to a certain extent, and the accuracy of the camera module zoom can be improved to a certain extent. However, the best case corresponding to this method is that the moving range of the lens is equal to the working range of the lens, so this method has limited ability to reduce the resolution of the analog-to-digital conversion module. For example, when the digital signal range output by the analog-to-digital conversion module is 5 code and the working range of the lens is 10 um (micrometer), this method can adjust the resolution of the analog-to-digital conversion module to 2 um / code at the lowest. However, if the resolution of the analog-to-digital conversion module required by the user is 1 um / code, then this method cannot achieve the resolution and zoom accuracy required by the user.

[0112] In view of this, an embodiment of the present application provides a zoom method, which is used to divide the working range of the lens into at least two sub-ranges. Since the stroke of each sub-range is smaller than the stroke of the working range, the position movement of the lens represented by each digital signal output by the analog-to-digital conversion module in each sub-range is smaller than the position movement in the entire working range. The controller can detect the position change of the lens at a finer granularity, thereby helping to improve the accuracy of the camera module zoom.

[0113] It should be noted that, in the embodiments of the present application, "at least one" refers to one or more, and "more" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may 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 previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.

[0114] Furthermore, in the description of the embodiments of this application, the terms "first," "second," and "third" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly specifying the number of the technical features indicated, for example: "first electrical signal," "second electrical signal," "third electrical signal," "first position information," and "second position information." Therefore, features defined as "first," "second," and "third" may explicitly or implicitly include one or more of such features.

[0115] Based on the above, Figure 3 The schematic diagram of the process flow of a zoom method provided in an embodiment of the present application is shown as an example. The method is applied to a camera module, which can be the above-mentioned Figure 1A The camera module 193 or the above Figure 1B Camera module 200, or Figure 2 The camera module 300 in the camera module. The method can be executed by a controller in the camera module, for example Figure 1B or Figure 2 The controller 240 in Figure 3 As shown, the method includes:

[0116] Step 301: The controller obtains the target focal length of the camera module.

[0117] Taking an electronic device including a camera module as an example, in an optional implementation, the processor in the electronic device can first determine the target focal length of the camera module based on the user's sliding touch operation on the touch screen of the electronic device, and then send the target focal length of the camera module to the controller in the camera module. Figure 4 A schematic diagram of an operation interface for a sliding touch operation is shown as an example. Figure 4 As shown, when the user's finger slides upward, the focus is enlarged, and when the user's finger slides downward, the focus is reduced. When the user's finger slides, the processor can obtain the position of the user's finger, and then determine the focal length corresponding to the position based on the preset correspondence between the position and the focal length. This focal length is the target focal length. Of course, Figure 4 This is just an exemplary explanation. The user's sliding touch operation can also be in other forms, for example, it can also be a two-finger circle operation. When the user's two fingers slide outward, it corresponds to enlarging the focal length, and when the user's two fingers slide inward, it corresponds to reducing the focal length. In this case, the processor determines the target focal length based on the sliding distance of the user's two fingers and the preset correspondence between the sliding distance and the focal length.

[0118] In the embodiment of the present application, "determining the target focal length based on a sliding touch operation" is only an optional implementation method. In other optional implementation methods, the target focal length can also be determined by parsing the user's voice commands, or the target focal length can be obtained by parsing the user's remote control commands, or the target focal length can be directly received from other components, without limitation.

[0119] In step 302 , the controller determines target position information of the lens in the camera module according to the target focal length of the camera module.

[0120] In the embodiment of the present application, the camera module may include one or more lenses. When multiple (ie, two or more) lenses are included, each lens may correspond to Figure 2 An optical zoom system is shown. If the camera module includes only one lens, the controller can determine the target position information of the lens based on the correspondence between the preset target focal length and the target position information of the lens after obtaining the target focal length of the camera module. If the camera module includes multiple lenses, the optical zoom system where each lens is located can correspond to the same controller. After determining the target focal length of the camera module, the controller can also determine the target position information of each lens based on the correspondence between the preset target focal length and the target position information of each lens. Among them, the correspondence between the preset target focal length and the target position information of the lens or the correspondence between the preset target focal length and the target position information of each lens can be pre-stored in the controller before the camera module leaves the factory. These correspondences can be obtained based on multiple experimental verifications or set based on human experience, and are not specifically limited.

[0121] The following embodiments of this application describe how to control a lens to stop at its corresponding target position from the perspective of a single lens. If the camera module includes multiple lenses, the controller can control each lens to stop at its corresponding target position using the methods described in the following embodiments. That is, in the following description, unless otherwise specified, "lens" refers to a single lens.

[0122] In step 303 , the controller determines whether the first position information of the current position of the lens is the same as the target position information. If they are different, step 304 is executed; if they are the same, step 311 is executed.

[0123] In an embodiment of the present application, the controller may store first position information of the current position of the lens, and this position information may be updated periodically. Specifically, the moment the user turns on the camera, the controller will perform an operation to calibrate the lens to a default position, i.e., the controller will send an electrical signal to the motor coil, which drives the motor magnet to move the lens to the default position. In this case, the first position information of the current position of the lens stored in the controller is the position information of the default position. After the user turns on the camera, even if the user does not trigger the zoom operation, the controller will periodically obtain the digital signal output by the analog-to-digital conversion module, determine the current position of the lens based on the digital signal, and update the first position information of the current position of the lens stored in the controller based on the determined current position of the lens. In this way, even if the current position of the lens is offset due to vibration of the mobile phone, the first position information of the current position of the lens stored in the controller can still be relatively accurate.

[0124] In step 304 , the controller inputs a first electrical signal to the motor according to the first position information and the target position information, so that the motor drives the lens to move within the working range.

[0125] In an optional embodiment, the controller can first calculate the distance between the current position of the lens and the target position based on the first position information and the target position information, and then determine the first electrical signal corresponding to the distance based on the preset correspondence between the distance and the electrical signal, and then apply a driving current to the motor coil according to the first electrical signal to drive the motor magnet to drive the lens to move from the current position to the target position. Among them, the preset correspondence between the distance and the electrical signal can specifically refer to the correspondence between the distance, the current value and the power-on time. This correspondence can be obtained based on experimental measurement, can be set based on human experience, or can be obtained based on analysis of the position positioning algorithm. This application does not limit this.

[0126] Table 1 shows a schematic diagram of the correspondence between a preset distance and an electrical signal. As shown in Table 1, if the current position of the lens is 5 μm away from the target position (for example Figure 2 If the current position of the lens 220 is 5 microns to the left of the target position), the controller can apply a 2A forward drive current to the motor coil, and the drive current gradually decreases with the power-on time. Figure 2 If the center lens 220 is currently located 5 microns to the right of the target position, the controller can apply a negative drive current of 2A (amperes) to the motor coil, and this drive current gradually decreases over time. Where um is the distance unit, i.e., micrometers; A is the current unit, i.e., amperes.

[0127] Distance (micrometers) Electrical signal (I is the current value, t is the power-on time) +5 I=2-0.5t -5 I=-2+0.5t End distance 0.5 I=0.5

[0128] Table 1

[0129] It should be noted that Table 1 is only a possible example listed for illustrating the solution. In specific implementations, the corresponding relationship between the preset distance and the electrical signal may also be in other forms and is not limited thereto.

[0130] In step 305, the controller determines the target sub-interval where the lens is located after the movement based on the position indication information of the lens detected by the Hall sensor module and the correspondence between the preset position indication information and the sub-interval, and determines the first configuration parameter of the analog-to-digital conversion module corresponding to the target sub-interval based on the correspondence between the preset sub-interval and the configuration parameters of the analog-to-digital conversion module.

[0131] In the embodiment of the present application, the working range of the lens may include N sub-ranges, the union of the N sub-ranges may not be less than the working range of the lens, and each of the N sub-ranges may correspond to a set of configuration parameters of the analog-to-digital conversion module. Where N is an integer greater than 1. The content of dividing the N sub-ranges and determining the configuration parameters of the analog-to-digital conversion module corresponding to each sub-range will be described in detail in the following sections. Figure 9 It will be described in detail in

[15] and will not be explained here. It is understandable that dividing the working range into N sub-ranges is only an optional implementation method. In the embodiment of the present application, any range that is not less than the working range and not greater than the mechanical range can be divided into N sub-ranges. As long as each sub-range is smaller than the working range and each sub-range is calibrated separately, the position detection accuracy of each sub-range can be improved.

[0132] In an optional embodiment, when the motor magnet drives the lens and the Hall magnet to move, the Hall coil can sense the change in the magnetic field of the Hall magnet and generate a third electrical signal (i.e., information indicating the position of the lens), and output the third electrical signal to the analog-to-digital conversion module. Correspondingly, the controller can also collect the third electrical signal output by the Hall coil, and based on the preset correspondence between the electrical signal output by the Hall coil and the sub-interval where the lens is located, determine the target sub-interval where the lens is located after movement, and use the configuration parameters of the analog-to-digital converter module corresponding to the target sub-interval as the first configuration parameters. The third electrical signal can be an analog voltage signal.

[0133] To facilitate understanding, a specific example is given below to illustrate.

[0134] Figure 5 The following is an example of a corresponding relationship diagram between the electrical signal output by a preset Hall coil and the sub-interval where the lens is located, as shown in FIG. Figure 5As shown, the working range of the lens (0um to 10um) is divided into sub-range 1 (0um to 5um) and sub-range 2 (5um to 10um), and there is no overlapping area between sub-range 1 and sub-range 2. Among them, sub-range 1 includes endpoints A1 and A2. When the lens (i.e., the Hall magnet) is located at endpoint A1, the analog voltage signal output by the Hall coil is 0mV. When the lens is located at endpoint A2, the analog voltage signal output by the Hall coil is 55mV. Therefore, when the lens is located at a certain position in sub-range 1, the analog voltage signal output by the Hall coil is a value between 0mV and 55mV. Correspondingly, sub-range 2 includes endpoints A2 and A3. When the lens is located at endpoint A2, the analog voltage signal output by the Hall coil is 55mV. When the lens is located at endpoint A3, the analog voltage signal output by the Hall coil is 120mV. Therefore, when the lens is located at a certain position in sub-range 2, the analog voltage signal output by the Hall coil is a value between 55mV and 120mV.

[0135] according to Figure 5 As shown in the corresponding relationship, after the lens moves, if the analog voltage signal output by the Hall coil is not less than 0mV and not greater than 55mV, the target subinterval in which the lens is located after the movement is determined to be subinterval 1. Therefore, the first configuration parameter is the configuration parameter of the analog-to-digital conversion module corresponding to subinterval 1. If the analog voltage signal output by the Hall coil is greater than 55mV and not greater than 120mV, the target subinterval in which the lens is located after the movement is determined to be subinterval 2. Therefore, the first configuration parameter is the configuration parameter of the analog-to-digital conversion module corresponding to subinterval 2. It should be noted that the description here takes endpoint A2 as being classified as subinterval 1 as an example. As to whether endpoint A2 belongs to subinterval 1 or subinterval 2, it can be set by the user according to actual needs and is not limited.

[0136] In the embodiment of the present application, since different sub-intervals correspond to different configuration parameters of the analog-to-digital conversion module, when the lens moves from one sub-interval to another, the configuration parameters of the analog-to-digital conversion module will also switch. At the moment of switching the configuration parameters, since the analog voltage signal output by the Hall coil remains unchanged, the analog voltage signal obtained after adjusting the analog voltage signal with different configuration parameters will also be different, resulting in a jump in the analog voltage signal inside the analog-to-digital conversion module and / or the output digital signal. The relevant content of the jump will be explained in the following embodiments and will not be introduced here.

[0137] Figure 6 Another example of a corresponding relationship diagram between the electrical signal output by the preset Hall coil and the sub-interval where the lens is located is shown, as shown in FIG. Figure 6As shown, the working range of the lens (0um to 10um) is divided into sub-range 3 (0um to 6um) and sub-range 4 (4um to 10um). There is an overlapping area of ​​4um to 10um between sub-range 3 and sub-range 4. Among them, sub-range 3 includes endpoints B1 and B3. When the lens (i.e., the Hall magnet) is at endpoint B1, the analog voltage signal output by the Hall coil is 0mV. When the lens is at endpoint B3, the analog voltage signal output by the Hall coil is 70mV. Therefore, when the lens is located at a certain position in sub-range 3, the analog voltage signal output by the Hall coil is a value between 0mV and 70mV. Correspondingly, sub-range 4 includes endpoints B2 and B4. When the lens is located at endpoint B2, the analog voltage signal output by the Hall coil is 50mV. When the lens is located at endpoint B4, the analog voltage signal output by the Hall coil is 120mV. Therefore, when the lens is located at a certain position in sub-range 4, the analog voltage signal output by the Hall coil is a value between 50mV and 120mV.

[0138] according to Figure 6 In the illustrated correspondence, after the lens moves, if the analog voltage signal output by the Hall coil is no less than 0mV and no greater than 50mV, the target subrange in which the lens is located after the movement is determined to be subrange 3. Therefore, the first configuration parameter is the configuration parameter of the analog-to-digital conversion module corresponding to subrange 3. If the analog voltage signal output by the Hall coil is no less than 70mV and no greater than 120mV, the target subrange in which the lens is located after the movement is determined to be subrange 4. Therefore, the first configuration parameter is the configuration parameter corresponding to subrange 4. If the analog voltage signal output by the Hall coil is greater than 50mV and less than 70mV, the analog voltage signal is simultaneously within the analog voltage signal range of subrange 3 and the analog voltage signal range of subrange 4. In this case, the lens is located within the overlapping area of ​​4μm to 6μm between subrange 3 and subrange 4. In this scenario, the controller can determine the target subrange in which the lens is located after the movement and the first configuration parameter in various ways. For example, the configuration parameter of the analog-to-digital conversion module corresponding to one of the subranges can be randomly selected as the first configuration parameter. Two possible implementations are described below.

[0139] In one possible embodiment, for subintervals 3 and 4 where there is an overlapping area, the controller may pre-set a preset position in the overlapping area as a reference point P. Reference point P may be any point in the overlapping area, such as point B2, point B3, or the center point between points B2 and B3. Assuming that when the lens is located at reference point P, the analog voltage signal output by the Hall coil is 55mV. If the analog voltage signal output by the Hall coil is not less than 0mV and not greater than 55mV, the target subinterval in which the lens is located after movement is determined to be subinterval 3, and therefore the first configuration parameter is the configuration parameter corresponding to subinterval 3. If the analog voltage signal output by the Hall coil is greater than 55mV and not greater than 120mV, the target subinterval in which the lens is located after movement is determined to be subinterval 4, and therefore the first configuration parameter is the configuration parameter corresponding to subinterval 4. This implementation is suitable for scenarios where the lens moves continuously, for example, the lens moves continuously from sub-interval 3 to sub-interval 4 without any reciprocating motion in between. In this case, the reference point can be set as a fixed point in the overlapping area. By comparing the analog voltage signal output by the Hall coil after the lens moves with the analog voltage signal at one of the endpoints of each sub-interval and the analog voltage signal of the reference point, the target sub-interval where the lens is located after moving can be determined, which makes it relatively simple to implement.

[0140] In another possible embodiment, for subintervals 3 and 4 that overlap, when the lens moves into the overlapping area, the controller uses the subinterval the lens was in at the previous moment as the target subinterval for the lens to be located after the movement. That is, the configuration parameter switch occurs only when the lens moves to the endpoint of one subinterval relative to the other subinterval. For example, if the lens moves from subinterval 3 to subinterval 4, as long as the analog voltage signal output by the Hall coil is not less than 0mV and not greater than 70mV, the target subinterval for the lens to be located after the movement is considered to be subinterval 3, and the first configuration parameter is the configuration parameter corresponding to subinterval 3. Only when the analog voltage signal output by the Hall coil is greater than 70mV and not less than 120mV, the target subinterval for the lens to be located after the movement is considered to be subinterval 4, and the first configuration parameter is the configuration parameter corresponding to subinterval 4. Correspondingly, if the lens moves from subinterval 4 to subinterval 3, as long as the analog voltage signal output by the Hall coil is not less than 50mV and not greater than 120mV, the target subinterval in which the lens is located after the movement is considered to be subinterval 4, and the first configuration parameter is the configuration parameter corresponding to subinterval 4. Only when the analog voltage signal output by the Hall coil is not less than 0mV and less than 50mV is the target subinterval in which the lens is located after the movement considered to be subinterval 3, and the first configuration parameter is the configuration parameter corresponding to subinterval 3. This embodiment is suitable for scenarios where the lens reciprocates near the overlapping area, for example, the lens reciprocates between endpoints B2 and B3. In this case, if the subinterval in which the lens was previously located was subinterval 3, then as long as the lens has not moved to endpoint B3, the lens remains in subinterval 3. In this case, the first configuration parameter remains the configuration parameter corresponding to subinterval 3. This approach can reduce the number of configuration parameter switching times, thereby reducing the number of analog voltage signal transitions within the analog-to-digital conversion module and / or the number of digital signal transitions output, thereby helping to maintain the stability of the optical zoom system.

[0141] Step 306: The controller processes the position indication information using the first configuration parameter via the analog-to-digital conversion module and outputs a first digital signal.

[0142] In a specific implementation, the controller can set the amplification factor of the first-stage amplifier, the amplification factor of the second-stage amplifier and the bias parameter of the bias device in the analog-to-digital conversion module to the first configuration parameter. In this way, when the Hall magnet moves, the third electrical signal output by the Hall coil is amplified and / or biased according to the first configuration parameter and then output to the ADC. The ADC samples the adjusted analog voltage signal at the set frequency, converts the sampled analog voltage signal into a first digital signal, and outputs it to the controller.

[0143] In step 307 , the controller determines second position information corresponding to the first digital signal according to the correspondence between the digital signal output by the preset analog-to-digital conversion module corresponding to the target sub-interval and the position information of the lens.

[0144] In an optional embodiment, for each sub-interval, the correspondence between the digital signal output by the preset analog-to-digital conversion module and the position information of the lens may be a linear relationship. In this case, the correspondence between the digital signal output by the preset analog-to-digital conversion module and the position information of the lens may include the following features: the digital signal output by the ADC corresponding to when the lens is located at one end point of the sub-interval (assuming it is digital signal 1), and the digital signal output by the ADC corresponding to when the lens is located at the other end point of the sub-interval (assuming it is digital signal 2). Among them, the absolute value of the difference between the digital signal 1 and the digital signal 2 in different sub-intervals may not be less than the difference in the preset digital signal range, and the difference between the digital signal 1 and the digital signal 2 in each sub-interval may be obtained by adjusting the configuration parameters corresponding to the sub-interval. How to adjust the configuration parameters so that the absolute value of the difference between the digital signal 1 and the digital signal 2 in different sub-intervals is not less than the difference in the preset digital signal range will be described in detail. Figure 9 The specific instructions are given in , so I will not introduce them here.

[0145] In one case, referring to Figure 5 Assume that when the lens is at endpoint A1, the configuration parameters corresponding to subinterval 1 are used to adjust the analog voltage signal (i.e., the fourth electrical signal) output by the Hall coil so that the ADC outputs the second digital signal D 12 When the lens is at endpoint A2, the configuration parameters corresponding to subinterval 1 are used to adjust the analog voltage signal (ie, the fifth electrical signal) output by the Hall coil, so that the ADC outputs the third digital signal D 13 When the lens is at endpoint A2, the configuration parameters corresponding to subinterval 2 are used to adjust the analog voltage signal (i.e., the sixth electrical signal) output by the Hall coil, so that the ADC outputs the fourth digital signal D 14 When the lens is at endpoint A3, the configuration parameters corresponding to subinterval 2 are used to adjust the analog voltage signal (i.e., the seventh electrical signal) output by the Hall coil, so that the ADC outputs the fifth digital signal D 15 , if the third digital signal D 13 and the fourth digital signal D 14 The corresponding relationship between the digital signal output by the preset analog-to-digital conversion module corresponding to each sub-interval and the position information of the lens can be as follows: Figure 7 In this case, since the digital signal and the position of the lens have the same linear relationship in subinterval 1 and subinterval 2, it is no longer necessary to determine which subinterval the first digital signal belongs to. Instead, the linear relationship can be directly determined based on the slope (i.e., 10 / (D15 -D 12 )) Determine the first digital signal (assuming D L ) The second position information of the lens corresponding to 10*D L / (D 15 -D 12 This method can directly determine the position of the lens after movement through a simple linear calculation. However, when calibrating the configuration parameters of subinterval 1 and subinterval 2, not only does it require adjusting the absolute value of the difference between the second digital signal and the third digital signal, and the absolute value of the difference between the fourth digital signal and the fifth digital signal, to be no less than the difference within the preset digital signal range, but it also requires adjusting the third digital signal and the fourth digital signal to be the same, which may make the calibration process slightly more complicated.

[0146] In another case, refer to Figure 6 , assuming that the lens is at endpoint B1, the ADC outputs the second digital signal D 22 When the lens is at endpoint B3, the ADC outputs the third digital signal D 23 When the lens is at endpoint B2, the ADC outputs the fourth digital signal D 24 When the lens is at endpoint B4, the ADC outputs the fifth digital signal D 25 , if the third digital signal D 23 and the fourth digital signal D 24 If different, the corresponding relationship between the digital signal output by the preset analog-to-digital conversion module and the position information of the lens can be as follows: Figure 8 In this case, when the position of the lens after movement is located in the overlapping area of ​​sub-interval 3 and sub-interval 4, the first digital signal (for example, D L ) will correspond to two location information, such as D L In sub-interval 3, the corresponding position is 5.5um, and D L In subinterval 4, the corresponding position is 4.5um. In this case, D L The corresponding second position information can be selected as the position information in the same sub-interval as the third position information. For example, if the sub-interval is determined according to the solution of the boundary point 6 μm of sub-interval 3 as the reference point, then when the lens moves from sub-interval 3 to sub-interval 4, since the lens has not yet moved to the boundary point 6 μm, D L The corresponding second position information may be 5.5 um in sub-interval 3.

[0147] In the embodiment of the present application, the above two situations are only two exemplary explanations. In other possible situations, the range of the digital signal output by the ADC can also be set according to the needs of the user. For example, the range of the digital signal output by the ADC corresponding to the two sub-intervals can be set to be consistent. In this way, regardless of whether the position of the lens after movement is within the overlapping area, the digital signal output by the ADC corresponding to the position of the lens after movement will correspond to two position information. In this case, the position information in the two position information that is in the same sub-interval as the third position information can be determined as the second position information.

[0148] In step 308 , the controller determines whether the second location information matches the target location information. If not, step 309 is executed. If so, step 310 is executed.

[0149] Step 309 : The controller inputs a second electrical signal to the motor according to the second position information and the target position information, so that the motor drives the lens to move.

[0150] In an optional embodiment, the second position information does not match the target position information, which may specifically mean that the second position information does not meet the end distance required for the lens to stop at the target position information. As shown in Table 1, the controller may also store the end distance. After the controller calculates the distance between the position of the lens after movement and the target position based on the second position information and the target position information, if the distance is not equal to the end distance, the controller may re-determine the second electrical signal corresponding to the distance based on the preset correspondence between the distance and the electrical signal, and then apply a driving current to the motor coil according to the second electrical signal to drive the motor magnet to drive the lens to continue moving toward the target position, and repeat steps 305 to 309 during the movement of the lens until the second position information matches the target position information.

[0151] In step 310 , the controller stops driving the lens to move.

[0152] In an optional embodiment, the second position information matches the target position information, which may specifically mean that the second position information satisfies the termination distance for the lens to stop at the target position information. As shown in Table 1, the controller may also store the correspondence between the termination distance and the electrical signal. After the controller calculates the distance between the position of the lens after movement and the target position based on the second position information and the target position information, if the distance is equal to the termination distance, the controller may apply a driving current to the motor coil according to the electrical signal corresponding to the termination distance to drive the motor magnet to drive the lens to stop at the target position. The termination distance may be a value slightly greater than 0, and the force generated by the electrical signal corresponding to the termination distance offsets the gravity and friction of the lens. In this way, when the motor magnet is driven according to the electrical signal corresponding to the termination distance, although the force corresponding to the electrical signal is offset, the motor magnet can still drive the lens to continue moving according to inertia and allow the lens to stop exactly at the target position.

[0153] In an embodiment of the present application, by dividing the working range of the lens into at least two sub-ranges, each digital signal output by the analog-to-digital conversion module can represent a smaller change in the position of the lens. For example, in the previous solution, 5 codes are used to represent a working range of 10 μm. The minimum resolution of the analog-to-digital conversion module can reach 2 codes / μm, that is, the controller can only detect that the lens is located at 2 μm, 4 μm, 6 μm, and 8 μm, and adjust the current applied to the motor coil at these positions. However, by dividing the working range of 10 μm into two sub-ranges (assuming that both sub-ranges are 5 μm), the resolution of the analog-to-digital conversion module can be reduced to 1 code / μm. Therefore, the controller can detect that the lens is located at 1 μm, 2 μm, 3 μm, ..., 7 μm, 8 μm, and 9 μm, and can adjust the current applied to the motor coil at these positions. In this way, the controller can more accurately control the current of the motor coil, so that the lens stops at the target position more accurately.

[0154] Step 311 : The controller responds to a user's shooting instruction and uses the target focal length to shoot.

[0155] In an embodiment of the present application, when a user clicks a shooting button on the screen of an electronic device, the processor in the electronic device can detect the user's shooting operation, and then generate a processing instruction based on the shooting operation, and send the processing instruction to the controller so that the controller can shoot according to the processing instruction.

[0156] In an embodiment of the present application, by continuously detecting the position of the lens during its movement and controlling the movement of the lens in different sub-intervals based on the position of the lens, the lens can be more accurately stopped at the position corresponding to the target focal length, which helps to improve the accuracy of the camera module focus. Furthermore, by dividing the working interval of the lens into at least two sub-intervals, each sub-interval can be smaller than the working interval. In this way, when the range of the digital signal output by the position detection module is consistent, the position movement amount (i.e., the movement distance) of the lens represented by each digital signal output by the position detection module in each sub-interval is smaller than the position movement amount in the entire working interval, so that the controller can detect the position change of the lens from a finer granularity, and the accuracy of the lens position detection is improved. Controlling the movement of the lens based on a more precise position can also further improve the accuracy of the camera module zoom.

[0157] Figure 9 A schematic diagram illustrating a flow chart of a calibration method provided in an embodiment of the present application is shown, which is applied to a camera module, such as the above Figure 1A The camera module 193, or the above Figure 1B The camera module 200 or the above Figure 2 The method can be executed by a controller in the camera module, such as the above Figure 1B or above Figure 2 The controller 240 in Figure 9 As shown, the method includes:

[0158] Step 901: The controller determines the minimum resolution of the analog-to-digital conversion module according to the working range of the lens and the hardware structure of the analog-to-digital conversion module.

[0159] In this embodiment of the present application, the controller can first determine the number of digital signals that the ADC can output based on the number of bits of the ADC. Then, based on the operating range of the lens and the number of digital signals that the ADC can output, the minimum resolution of the analog-to-digital conversion module can be determined. For example, if the operating range of the lens is 10 μm and the number of digital signals that the ADC can output is 5 codes, the minimum resolution of the analog-to-digital conversion module is 2 μm / code, meaning that each digital signal output by the analog-to-digital conversion module can represent a minimum change in the lens position of 2 μm.

[0160] It should be noted that "determining the resolution of the analog-to-digital conversion module based on the hardware structure of the analog-to-digital conversion module" is only an optional implementation method. In another optional implementation method, considering reserving a certain digital signal range for the analog-to-digital conversion module so that the analog-to-digital conversion module can continue to be used in emergency situations, the resolution of the analog-to-digital conversion module can also be determined based on the difference in the preset digital signal range. Among them, the difference in the preset digital signal range can be pre-set by the user based on a number of factors, and the multiple factors may include the cost of the camera module, user needs, development difficulty, etc. The difference in the preset digital signal range refers to the number of digital signals in the preset digital signal range, and the difference can be less than the number of digital signals that the ADC can output. For example, when the detection bit number of the ADC is 12 bits, the difference in the preset digital signal range may not be greater than any integer of 4096, such as 400.

[0161] In step 902 , the controller determines whether the minimum resolution of the analog-to-digital conversion module is lower than the resolution required by the user. If so, step 903 is executed; if not, step 904 is executed.

[0162] Step 903: The controller calibrates the working range of the lens using the difference in the preset digital signal range to obtain configuration parameters of the analog-to-digital conversion module.

[0163] For example, if the user's desired resolution is 3µm / code, this means they expect each digital signal output by the A / D conversion module to represent a 3µm change in the lens' position. In reality, each digital signal output by the A / D conversion module represents a 2µm change in the lens' position, thus meeting the user's accuracy requirements. In this case, the controller can directly calibrate the lens' operating range based on the range of digital signals the A / D conversion module can output, thereby obtaining the A / D conversion module's configuration parameters. Alternatively, the controller can calibrate the lens' operating range based on the difference between pre-set digital signal ranges to obtain the A / D conversion module's configuration parameters, without limitation.

[0164] Regarding the specific implementation method of calibrating the configuration parameters of the analog-to-digital conversion module, please refer to the description below and will not be repeated here. In addition, the following example uses the method of calibrating each sub-interval based on the difference of the preset digital signal range as an example. However, the method of calibrating the working interval based on the range of digital signals that the analog-to-digital conversion module can be implemented similarly and will not be described in this application.

[0165] In step 904 , the controller divides the working range of the lens into N sub-ranges, where N is an integer greater than 1, and executes the following steps 905 to 909 for each sub-range.

[0166] For example, if the user's required resolution is 1.5um / code, it means that the user hopes that each digital signal output by the analog-to-digital conversion module can represent a 1.5um position change of the lens. However, due to the hardware structure limitations of the analog-to-digital conversion module, each digital signal output by the analog-to-digital conversion module can only represent a 2um position change of the lens, and this accuracy cannot meet the user's needs. In this case, the controller can divide the working range of the lens into N sub-ranges and calibrate each sub-range separately. The union of the N sub-ranges can be equal to the working range of the lens. In this way, there is no overlapping area between any two sub-ranges in the N sub-ranges, and the sum of the travels of the N sub-ranges is exactly equal to the travel of the working range of the lens. Alternatively, there are two or more sub-ranges in the N sub-ranges that have overlapping areas. In this way, the sum of the travels of the N sub-ranges is greater than the travel of the working range of the lens.

[0167] In an embodiment of the present application, by dividing the working range of the lens into at least two sub-ranges, the stroke of each sub-range can be smaller than the stroke of the working range. In this way, compared with the solution of directly calibrating the working range or directly calibrating the mechanical range, under the analog-to-digital conversion module with the same hardware structure, the position change of the lens represented by each digital signal output by the analog-to-digital conversion module is reduced, so that the accuracy of the analog-to-digital conversion module can be improved.

[0168] In an alternative embodiment, the value of N and the travel of each subinterval can be determined based on the user's desired resolution. To ensure that the resolution of the analog-to-digital conversion module in each subinterval is lower than the user's desired resolution, the ratio of the travel of each subinterval to the difference between the preset digital signal range must be no greater than the user's desired resolution. Given the difference between the user's desired resolution and the preset digital signal range, the maximum travel of each subinterval can be calculated. Thus, when dividing the working range, it is sufficient to ensure that the travel of each subinterval is no greater than the calculated maximum travel of each subinterval. For example, assuming the lens's working range is 10 μm, the preset difference between the digital signal range is 5 codes, and the user's desired resolution is 1.5 μm / code, the maximum travel of each subinterval can be calculated to be 7.5 μm. Therefore, when dividing the subintervals, it is sufficient to ensure that the travel of each subinterval is no greater than 7.5 μm. For example, the lens's working range can be divided into subinterval 1 and subinterval 2, with subinterval 1 corresponding to 0 μm to 5 μm and subinterval 2 corresponding to 5 μm to 10 μm. In this way, the resolution of the analog-to-digital conversion module in both subintervals 1 and 2 is 1 μm / code. Alternatively, the working range of the lens can be divided into sub-range 3 and sub-range 4, where sub-range 3 corresponds to 0um to 6um and sub-range 4 corresponds to 4um to 10um. In this way, the resolution of the analog-to-digital conversion module in sub-range 3 and sub-range 4 is 1.2um / code.

[0169] In step 905, the controller inputs an electrical signal to the motor, causing the motor to drive the lens to move to the endpoints T1 and T2 of the sub-interval, respectively. The endpoints T1 and T2 are the two boundary points of the sub-interval, respectively.

[0170] In an embodiment of the present application, the controller may first determine the position information of the current position of the lens, and then calculate the distance between the current position of the lens and the endpoint T1 of the sub-interval based on the position information of the current position of the lens and the endpoint T1 of the sub-interval, and then determine the electrical signal corresponding to the distance based on the preset correspondence between the distance and the electrical signal, and then apply a driving current to the motor coil according to the electrical signal to drive the motor magnet to drive the lens to move to the endpoint T1 of the sub-interval. After the lens moves to the endpoint T1 of the sub-interval, the controller may also calculate the distance between the endpoint T1 of the sub-interval and the endpoint T2 of the sub-interval based on the endpoint T1 of the sub-interval and the endpoint T2 of the sub-interval, and then determine the electrical signal corresponding to the distance based on the preset correspondence between the distance and the electrical signal, and then apply a driving current to the motor coil according to the electrical signal to drive the motor magnet to drive the lens to move to the endpoint T2 of the sub-interval. It should be noted that this is only an optional implementation. In another optional implementation, after the lens moves to the endpoint T1 of the sub-interval, the controller can first drive the lens to move to the original position through the motor, and then drive the lens from the original position to the endpoint T2 of the sub-interval through the motor.

[0171] In step 906, the controller processes the position indication information of the lens moving to the endpoint T1 of the sub-interval using the default configuration parameters through the analog-to-digital conversion module, and outputs a sixth digital signal. The controller also processes the position indication information of the lens moving to the endpoint T2 of the sub-interval using the default configuration parameters through the analog-to-digital conversion module, and outputs a seventh digital signal.

[0172] In this embodiment of the present application, before calibrating the subinterval, the controller may also set the configuration parameters of the analog-to-digital conversion module to default configuration parameters, for example, setting the amplification factor AmpGain of the first-stage amplifier to 0, the amplification factor Bias of the second-stage amplifier to 0, and the bias factor Offset of the bias breaker to 0. In this way, when the lens moves to the endpoint T1 of the subinterval, the analog voltage signal output by the Hall coil is amplified and / or biased according to the default configuration parameters, and then converted into a sixth digital signal via the ADC. Correspondingly, when the lens moves to the endpoint T2 of the subinterval, the analog voltage signal output by the Hall coil is amplified and / or biased according to the default configuration parameters, and then converted into a seventh digital signal via the ADC. For example, assuming that a digital signal of the ADC can represent a voltage change of 50 / 4096V (approximately 12mV), if the analog voltage signal 0mV corresponding to the endpoint T1 of the sub-interval and the analog voltage signal 15mV corresponding to the endpoint T2 of the sub-interval are respectively changed to 0mV and 15mV after amplification adjustment (amplification factor is 0) and offset adjustment (bias factor is 0), then the sixth digital signal can be 1code and the seventh digital signal can be 2code.

[0173] In step 907 , the controller determines whether the absolute value of the difference between the sixth digital signal and the seventh digital signal in the subinterval matches the difference in the preset digital signal range. If not, step 908 is executed; if so, step 909 is executed.

[0174] In an optional embodiment, the absolute value of the difference between the sixth digital signal and the seventh digital signal matches the difference of the preset digital signal range, specifically referring to: the absolute value of the difference between the sixth digital signal and the seventh digital signal is not less than the difference of the preset digital signal range. In another optional embodiment, the absolute value of the difference between the sixth digital signal and the seventh digital signal does not match the difference of the preset digital signal range, specifically referring to: the absolute value of the difference between the sixth digital signal and the seventh digital signal is less than the difference of the preset digital signal range. In the above example, assuming that the difference of the preset digital signal range is 5code, since the absolute value of the difference between the sixth digital signal 1code and the seventh digital signal 2code is 1code (less than 5code), the absolute value of the difference between the sixth digital signal 1code and the seventh digital signal 2code does not match the difference of the preset digital signal range.

[0175] In step 908 , the controller adjusts the configuration parameters of the analog-to-digital conversion module corresponding to the sub-interval according to the difference in the preset digital signal range and the sixth digital signal and the seventh digital signal of the sub-interval.

[0176] In an optional implementation manner, the controller adjusts the configuration parameters of the analog-to-digital conversion module corresponding to the sub-interval, which may include one or more of the following:

[0177] If the absolute value of the difference between the sixth digital signal and the seventh digital signal in the subinterval is smaller than the difference within the preset digital signal range, increasing the amplification factor of the first-stage amplifier and / or increasing the amplification factor of the second-stage amplifier;

[0178] After increasing the amplification factor of the first-stage amplifier and / or the amplification factor of the second-stage amplifier, if the center points of the re-collected sixth digital signal and the seventh digital signal after adjustment are offset compared to the center points of the sixth digital signal and the seventh digital signal before adjustment, the bias coefficient of the bias device is adjusted.

[0179] For example, because the amplification factor of the first-stage amplifier has a significant adjustment range for the analog voltage signal, it is generally not necessary to adjust the amplification factor of the first-stage amplifier. Instead, only the amplification factor of the second-stage amplifier can be adjusted. When the amplification factor of the second-stage amplifier has been adjusted to its maximum value and still fails to meet the difference within the preset digital signal range, the amplification factor of the first-stage amplifier can be adjusted again. Furthermore, after the amplification adjustment, the analog voltage signal output by the Hall coil is adjusted to a larger value. However, after this value is converted into a digital signal via the ADC, it may exceed the limit range specified by the controller software. In this case, by adjusting the bias coefficient of the bias device, the digital signal corresponding to the amplified analog voltage signal can still fall within the limit range specified by the controller software, thereby facilitating the subsequent normal processing of the digital signal and reducing the possibility of information distortion.

[0180] In an embodiment of the present application, after adjusting the configuration parameters of the analog-to-digital conversion module corresponding to a sub-interval, the controller can re-input an electrical signal into the motor, causing the motor to drive the lens to move to endpoints T1 and T2 of the sub-interval, respectively. In this case, the analog voltage signal output by the Hall coil is amplified and / or offset-adjusted according to the adjusted configuration parameters, and then converted into a new sixth digital signal and a new seventh digital signal via the ADC. The controller then re-determines whether the absolute value of the difference between the new sixth digital signal and the new seventh digital signal matches the difference within the preset digital signal range. If it still does not match, the above steps are repeated until the absolute value of the difference between the sixth and seventh digital signals matches the difference within the preset digital signal range.

[0181] In step 909 , the controller establishes a correspondence between the subinterval and the current configuration parameters of the analog-to-digital conversion module, ie, uses the current configuration parameters of the analog-to-digital conversion module as the configuration parameters of the analog-to-digital conversion module corresponding to the subinterval.

[0182] In an optional embodiment, the output end of the Hall coil can also be connected to a collection device. When the lens moves from the endpoint T1 to the endpoint T2 of each sub-interval, the controller can also collect the analog voltage signal output by the Hall coil during this period through the collection device, and obtain the analog voltage signal output by the Hall coil when the lens is located at the endpoint T1 of each sub-interval and the analog voltage signal output by the Hall coil when the lens is located at the endpoint T2 of each sub-interval from the analog voltage signal during this period. Based on the two analog voltage signals corresponding to the N sub-intervals, a preset correspondence between the electrical signal output by the Hall coil and the sub-interval where the lens is located is established, such as Figure 5 Alternatively, in one example, if there is an overlapping area between two sub-intervals and a reference point is set in the overlapping area, the controller can also provide a certain driving current to the motor to drive the motor to move the lens to the reference point, and obtain the analog voltage signal output by the Hall coil when the lens is at the reference point through the sampling device. Then, based on the analog voltage signals at the two ends corresponding to the N sub-intervals and the analog voltage signal of the reference point of the sub-interval with the overlapping area, a corresponding relationship between the preset electrical signal output by the Hall coil and the sub-interval where the lens is located is established, as shown in FIG. Figure 6 shown.

[0183] In the embodiment of the present application, when the digital signal output by the analog-to-digital conversion module has a linear correlation with the position information of the lens, since each sub-interval is calibrated using the difference of the preset digital signal range, after the absolute value of the difference between the sixth digital signal and the seventh digital signal in the sub-interval matches the difference of the preset digital signal range, the controller can also establish a corresponding relationship between the digital signal output by the analog-to-digital conversion module in the sub-interval and the position information of the lens based on the difference between the sixth digital signal and the seventh digital signal and the travel of the sub-interval, such as Figure 7 or Figure 8 shown.

[0184] In an embodiment of the present application, by dividing the working range into N sub-ranges, a digital signal from the analog-to-digital conversion module in each sub-range can represent a smaller change in the movement of the lens, and the smaller the sub-range, the lower the resolution of the analog-to-digital conversion module. Ideally, assuming that the travel of the N sub-ranges is the same, then compared to the solution of directly calibrating using the working range, since the travel of each of the N sub-ranges is reduced by N times, the resolution of the analog-to-digital conversion module can also be reduced by N times. On this basis, the electronic device can more accurately detect the position change of the lens, thereby helping to control the lens to accurately stop at the target position corresponding to the target focal length, improving the focusing accuracy of the camera module. Moreover, the solution in the embodiment of the present application can divide the N sub-ranges according to the resolution required by the user. Therefore, even in the case of a high zoom scene resulting in a large working range, by dividing more sub-ranges, the resolution of the analog-to-digital conversion module in each sub-range can be lowered, which helps to improve the clarity of the photos or videos taken by the user.

[0185] In the embodiment of this application, Figure 3 and Figure 9 The position detection module includes a Hall sensor module and an analog-to-digital conversion module as an example for illustrative description. In this case, the position detection relationship corresponding to each sub-interval includes the configuration parameters of the analog-to-digital conversion module corresponding to the sub-interval described above, and the corresponding relationship between the digital signal output by the analog-to-digital conversion module corresponding to the sub-interval and the position information of the lens. It can be understood that in other examples, when the position detection module has other structures, the position detection relationship corresponding to each sub-interval can also be in other forms. As long as the position detection relationship makes the movement distance of the lens represented by each digital signal less than the movement distance of the lens represented by each digital signal corresponding to the corresponding relationship obtained by calibrating the entire working interval using the difference of the same preset digital signal range, it falls within the scope of protection of this application. There are many possible implementation methods, and this application will not go into details one by one.

[0186] In the embodiment of the present application, although each sub-interval is calibrated using the difference of the same preset digital signal range, since the component parameters (such as the impedance of the first amplifier, the impedance of the second amplifier, and the impedance of the bias device) between different sub-intervals, the friction of the material, and the length of the material cannot be completely consistent, the noise interference between different sub-intervals is different. Thus, even if the stroke of each sub-interval is consistent, the configuration parameters of the analog-to-digital conversion module obtained by calibration in different sub-intervals are likely to be different. In this case, for two sub-intervals with overlapping areas, although the analog voltage signal output by the Hall coil is the same when the Hall magnet is located in the overlapping area, since the configuration parameters of the analog-to-digital conversion module corresponding to the two sub-intervals are different, when the configuration parameters of the analog-to-digital conversion module are switched at a certain point in the overlapping area, the analog voltage signal output by the first amplifier, the analog voltage signal received by the second amplifier, the analog voltage signal output by the second amplifier, the analog voltage signal received by the bias device, the analog voltage signal output by the bias device, and the analog voltage signal received by the ADC may all be different using the configuration parameters of the two sub-intervals to adjust the same analog voltage signal. In other words, when the configuration parameters are switched, the above-mentioned analog voltage signals may all jump.

[0187] The following uses an analog voltage signal received by an ADC as an example to describe the transition process of the analog voltage signal when switching configuration parameters.

[0188] In an optional embodiment, for each sub-interval, the controller can also establish a correspondence between the analog voltage signal received by the ADC and the digital signal output by the ADC when the Hall magnet moves between the sub-intervals, and then obtain the correspondence between the analog voltage signal received by the ADC and the position information of the lens when the Hall magnet moves between the sub-intervals based on the correspondence and the correspondence between the digital signal output by the ADC in the sub-interval and the position information of the lens. Figure 6 The subinterval division method shown is: Figure 10 The following diagram illustrates the correspondence between the analog voltage signal received by the ADC and the position information of the lens. In this example, the working range of 0 to 10 μm is divided into sub-ranges 3 and 4. Sub-range 3 corresponds to 0 to 6 μm, and sub-range 4 corresponds to 4 to 10 μm. There is an overlapping area of ​​4 to 10 μm between sub-ranges 3 and 4. Figure 10 As shown, in the non-overlapping area of ​​subinterval 3 and subinterval 4, each analog voltage signal received by the ADC corresponds to a unique lens position, while in the overlapping area of ​​subinterval 3 and subinterval 4, each analog voltage signal received by the ADC can correspond to two lens positions, one of which is located in subinterval 3 and the other is located in subinterval 4.

[0189] Assuming that the reference point P set in the overlapping area is 5um, when the lens moves from sub-interval 3 to sub-interval 4, the controller first uses the configuration parameters of the analog-to-digital conversion module corresponding to sub-interval 3 to adjust the analog voltage signal output by the Hall coil. When the Hall magnet moves to the reference point 5um, the controller switches the configuration parameters of the analog-to-digital conversion module to the configuration parameters of the analog-to-digital conversion module corresponding to sub-interval 4, that is, uses the configuration parameters of the analog-to-digital conversion module corresponding to sub-interval 4 to adjust the analog voltage signal output by the Hall coil. In this case, since the analog voltage signal output by the Hall coil does not change at the moment of switching the configuration parameters, the analog voltage signal received by the ADC jumps after the analog voltage signal is adjusted by the new configuration parameters, that is, Figure 10 Position P1 in the image jumps to position P2. Correspondingly, when the lens moves from sub-interval 4 to sub-interval 3, the controller uses the configuration parameters of the analog-to-digital conversion module corresponding to sub-interval 4 to adjust the analog voltage signal output by the Hall coil. When the Hall magnet moves to the reference point 5um, the controller switches the configuration parameters of the analog-to-digital conversion module to the configuration parameters of the analog-to-digital conversion module corresponding to sub-interval 3, that is, uses the configuration parameters of the analog-to-digital conversion module corresponding to sub-interval 3 to adjust the analog voltage signal output by the Hall coil. In this case, since the analog voltage signal output by the Hall coil does not change at the moment of switching the configuration parameters, the analog voltage signal received by the ADC jumps after the analog voltage signal is adjusted by the new configuration parameters, that is, Figure 10 The position P2 in the circuit jumps to the position P1.

[0190] According to the above content, in an optional embodiment, the controller can also determine whether the configuration parameters of the analog-to-digital conversion module are switched during the zoom process by detecting one or more of the following: the analog voltage signal output by the first amplifier, the analog voltage signal received by the second amplifier, the analog voltage signal output by the second amplifier, the analog voltage signal received by the bias device, the analog voltage signal output by the bias device, and the analog voltage signal received by the ADC. In the embodiment of the present application, "determining whether the configuration parameters are switched by detecting the analog voltage signal" is only an optional embodiment. In another optional embodiment, since the equivalent impedance of the first amplifier, the second amplifier, and the bias device does not basically change at the moment of switching the configuration parameters, the analog voltage signals received and / or output by the first amplifier, the second amplifier, and the bias device will jump, and thus the analog current signals on the first amplifier, the second amplifier, and the bias device will also jump. In this case, it is also possible to determine whether the configuration parameters of the analog-to-digital conversion module are switched during the zoom process by detecting one or more of the following: the analog current signal on the first amplifier, the analog current signal on the second amplifier, the analog current signal on the bias device, and the analog current signal on the ADC.

[0191] Figure 11 A schematic diagram exemplarily illustrates a method of detecting whether a configuration parameter of an analog-to-digital conversion module is switched by a secondary amplifier, wherein:

[0192] In one embodiment, the first terminal of the test instrument can be connected to the first input terminal a1 of the secondary amplifier, and the second terminal of the test instrument can be connected to the second input terminal a2 of the secondary amplifier. In this way, during the continuous zoom process, the test instrument obtains the current I input to the first input terminal a1 of the secondary amplifier in real time through the first terminal. in1 , obtain the current I inputted by the second input terminal a2 of the secondary amplifier in real time through the second terminal in2 , according to the current I in1 and current I in2 Calculate the real-time current I on the secondary amplifier in1 -I in2 If the current jumps during the continuous zoom process, it is determined that the configuration parameters of the analog-to-digital conversion module are switched.

[0193] In another case, the first terminal of the test instrument can be connected to the first output terminal b1 of the secondary amplifier, and the second terminal of the test instrument can be connected to the second output terminal b2 of the secondary amplifier. In this way, during the continuous zoom process, the test instrument obtains the voltage V output by the first output terminal b1 of the secondary amplifier in real time through the first terminal. out1 , obtain the voltage V output by the second output terminal b2 of the secondary amplifier in real time through the second terminal out2 , according to the voltage V out1 and voltage V out2 Calculate the real-time output voltage V of the secondary amplifier out1 -V out2 If the voltage jumps during the continuous zoom process, it is determined that the configuration parameters of the analog-to-digital conversion module are switched.

[0194] For example, in the embodiments of the present application, the above method can detect the jump of the analog voltage signal or the jump of the analog current signal only when the jump amount of the analog voltage signal or the jump amount of the analog current signal exceeds the noise of the analog-to-digital conversion module. If the jump amount of the analog voltage signal or the jump amount of the analog current signal does not exceed the noise of the Hall sensor, the jump amount of the analog voltage signal or the jump amount of the analog current signal will be considered as noise interference and will be compensated. In this case, the jump of the analog voltage signal or the jump of the analog current signal cannot be detected.

[0195] Based on the above embodiments and the same concept, Figure 12 A schematic diagram of a controller provided in an embodiment of the present application is shown in FIG. Figure 12As shown, the controller 1201 can be a chip or a circuit, such as a chip or circuit that can be set in a camera module.

[0196] like Figure 12 As shown, the controller 1201 may include an acquisition unit 1202 , a control unit 1203 and a detection unit 1204 .

[0197] In one possible implementation, an acquisition unit 1202 is configured to acquire a target focal length. A control unit 1203 is configured to control the movement of the lens within different subranges based on the target focal length. The working range includes N subranges, where N is an integer greater than or equal to 2, each subrange is smaller than the working area, and each subrange corresponds to a position detection relationship that defines the ability of each digital signal output by the position detection module to represent the movement distance of the lens within the subrange. The detection unit 1202 is configured to determine the position information of the lens using the position detection relationship of the subrange in which the lens is currently located as the lens moves within each subrange.

[0198] In an optional embodiment, the N subintervals may include a first subinterval and a second subinterval, where the first subinterval and the second subinterval are adjacent and have an overlapping area. The control unit 1203 is further configured to: before the lens moves to a preset position in the overlapping area, determine the first subinterval as the subinterval in which the lens is currently located; and after the lens moves to the preset position in the overlapping area, determine the second subinterval as the subinterval in which the lens is currently located.

[0199] In an optional embodiment, the preset position is the end position of the overlapping area, and the lens moves out of the overlapping area at the end position.

[0200] In an optional embodiment, the control unit 1203 is specifically configured to: determine the target position information of the lens based on the target focal length; when the first position information of the current position of the lens does not match the target position information, input a first electrical signal to the drive component based on the first position information and the target position information, so that the drive component drives the lens to move. Correspondingly, the detection unit 1204 is specifically configured to: use the position detection relationship of the sub-interval where the lens is located after movement to determine the second position information of the lens after movement. The control unit 1203 is also configured to: when the second position information does not match the target position information, input a second electrical signal to the drive component based on the second position information and the target position information, so that the drive component drives the lens to continue moving; and when the second position information matches the target position information, stop driving the lens to move.

[0201] In an optional embodiment, the position detection module may include a Hall sensor module and an analog-to-digital conversion module, and the position detection relationship for each sub-interval includes the configuration parameters of the analog-to-digital conversion module corresponding to the sub-interval, and the correspondence between the digital signal output by the analog-to-digital conversion module corresponding to the sub-interval and the position information of the lens. In this case, the detection unit 1204 is specifically configured to: first determine the target sub-interval where the lens is located after movement based on the position indication information of the lens detected by the Hall sensor module and the preset correspondence between the position indication information and the sub-interval; then, process the position indication information using the first configuration parameters of the analog-to-digital conversion module corresponding to the target sub-interval, outputting a first digital signal; and then, determine second position information corresponding to the first digital signal based on the correspondence between the digital signal output by the analog-to-digital conversion module corresponding to the target sub-interval and the position information of the lens. The position indication information is used to indicate the position information of the lens after movement.

[0202] In an optional embodiment, the drive assembly may include a motor, and the Hall sensor module may include a Hall magnet and a Hall coil, wherein the Hall magnet is fixedly connected to the lens. The position indication information may be an electrical signal output by the Hall coil. In this case, the control unit 1203 is specifically configured to: drive the lens and the Hall magnet to move via the motor. The detection unit 1204 is specifically configured to: output a third electrical signal to the analog-to-digital conversion module via the Hall coil when the Hall magnet moves, and determine the target subinterval corresponding to the third electrical signal based on a preset correspondence between the electrical signal output by the Hall coil and the subinterval in which the lens is located.

[0203] In an optional embodiment, the analog-to-digital conversion module may include a first-stage amplifier, a second-stage amplifier, a bias device, and an analog-to-digital converter, wherein the input of the first-stage amplifier is connected to the Hall coil, the output of the first-stage amplifier is connected to the input of the second-stage amplifier, the output of the second-stage amplifier is connected to the input of the bias device, and the output of the bias device is connected to the input of the analog-to-digital converter. The first configuration parameter includes: an amplification factor of the first-stage amplifier, an amplification factor of the second-stage amplifier, and a bias factor of the bias device. In this case, the detection unit 1204 is specifically configured to process the third electrical signal via the first-stage amplifier, the second-stage amplifier, and the bias device, and output the first digital signal via the analog-to-digital converter.

[0204] In an optional embodiment, the N subintervals may include a first subinterval and a second subinterval, the first subinterval and the second subinterval being adjacent and having an overlapping area, and the detection unit 1204 is specifically configured to: when the position indication information of the lens detected by the Hall sensor module matches the position indication information corresponding to the first subinterval, determine that the target subinterval is the first subinterval, wherein the position indication information corresponding to the first subinterval includes the position indication information of the lens detected by the Hall sensor module when the lens is located at any position between the first endpoint and the preset position of the first subinterval, and the first endpoint is not within the overlapping area. When the position indication information of the lens detected by the Hall sensor module matches the position indication information corresponding to the second subinterval, determine that the target subinterval is the second subinterval, wherein the position indication information corresponding to the second subinterval includes the position indication information of the lens detected by the Hall sensor module when the lens is located at any position between the preset position and the second endpoint of the second subinterval, and the second endpoint is not within the overlapping area. The preset position is a position within the overlapping area.

[0205] In an optional embodiment, the N subintervals may include a third subinterval and a fourth subinterval, the third subinterval including a third endpoint and a fourth endpoint, and the fourth subinterval including a fifth endpoint and a sixth endpoint. Before the detection unit 1204 determines the target position information of the lens based on the target focal length, the control unit 1203 is further configured to: control the drive assembly to drive the lens to move between the third subinterval and the fourth subinterval. The detection unit 1204 is further configured to: when the lens is at the third endpoint, process the fourth electrical signal using the second configuration parameters via the analog-to-digital conversion module to output a second digital signal; when the lens is at the fourth endpoint, process the fifth electrical signal using the second configuration parameters via the analog-to-digital conversion module to output a third digital signal; when the lens is at the fifth endpoint, process the sixth electrical signal using the third configuration parameters via the analog-to-digital conversion module to output a fourth digital signal; and when the lens is at the sixth endpoint, process the seventh electrical signal using the third configuration parameters via the analog-to-digital conversion module to output a fifth digital signal. Among them, the difference between the second digital signal and the third digital signal is a first difference, the difference between the fourth digital signal and the fifth digital signal is a second difference, and the absolute value of the first difference and the absolute value of the second difference are not less than the difference of the preset digital signal range.

[0206] In an optional embodiment, the correspondence between the digital signal output by the analog-to-digital conversion module and the lens position information in the third subinterval includes the following characteristics: the second digital signal corresponds to the position information of the third endpoint, and the third digital signal corresponds to the position information of the fourth endpoint. Correspondingly, the correspondence between the digital signal output by the analog-to-digital conversion module and the lens position information in the fourth subinterval includes the following characteristics: the fourth digital signal corresponds to the position information of the fifth endpoint, and the fifth digital signal corresponds to the position information of the sixth endpoint.

[0207] In an optional embodiment, the union of the N sub-intervals is not smaller than the working interval of the lens.

[0208] For the concepts, explanations, detailed descriptions and other steps involved in the controller and related to the technical solutions provided in the embodiments of this application, please refer to the descriptions of these contents in the aforementioned methods or other embodiments, which will not be repeated here.

[0209] It is understandable that the functions of the various units in the above-mentioned controller 1201 can be implemented with reference to the corresponding method embodiments, and will not be repeated here.

[0210] It should be understood that the division of the units of the above controller is merely a division of logical functions, and in actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated.

[0211] According to the method provided in the embodiment of the present application, the present application also provides a computer program product, which includes: a computer program code, which, when executed on a computer, causes the computer to execute Figures 3 to 11 A method according to any one of the embodiments shown.

[0212] According to the method provided in the embodiment of the present application, the present application also provides a computer-readable storage medium, which stores a program code, and when the program code is run on a computer, the computer executes Figures 3 to 11 A method according to any one of the embodiments shown.

[0213] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware or any combination thereof. When implemented using software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, all or part of the processes or functions according to the embodiments of the present application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated therein. Available media may be magnetic media (eg, floppy disks, hard disks, tapes), optical media (eg, high-density digital video discs (DVDs)), or semiconductor media (eg, solid state discs (SSDs)).

[0214] The controllers in the above-mentioned various device embodiments correspond to the controllers in the method embodiments, and the corresponding modules or units perform the corresponding steps. For example, the communication unit (transceiver) performs the receiving or sending steps in the method embodiments, and other steps except sending and receiving can be performed by the processing unit (processor). The functions of the specific units can be referred to the corresponding method embodiments. Among them, there can be one or more processors.

[0215] As used in this specification, the terms "component," "module," "system," and the like are used to refer to computer-related entities, hardware, firmware, a combination of hardware and software, software, or software in execution. For example, a component can be, but is not limited to, a process running on a processor, a processor, an object, an executable file, an execution thread, a program, and / or a computer. By way of illustration, both an application running on a computing device and a computing device can be a component. One or more components can reside in a process and / or an execution thread, and a component can be located on one computer and / or distributed between two or more computers. In addition, these components can be executed from various computer-readable media having various data structures stored thereon. Components can communicate, for example, via local and / or remote processes based on signals having one or more data packets (e.g., data from two components interacting with another component across a local system, a distributed system, and / or a network, such as the Internet interacting with other systems via signals).

[0216] Those skilled in the art will appreciate that the various illustrative logical blocks and steps described in conjunction with the embodiments disclosed herein can be implemented using electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0217] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0218] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of 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 system, 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.

[0219] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0220] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

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

[0222] The above are only specific embodiments of the present application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. A zoom method, characterized in that: For a camera module, the camera module includes a lens, a drive component, a position detection module, and a controller, the controller is used to control the drive component to drive the lens to move within a working range; wherein the working range includes N sub-ranges, where N is an integer greater than or equal to 2, and each sub-range is smaller than the working range; each sub-range corresponds to a position detection relationship, and the position detection relationship is used to define the ability of each digital signal output by the position detection module to represent the movement distance of the lens in the sub-range; the method is executed by the controller, and includes: Get the target focal length; Controlling the lens to move in different sub-intervals according to the target focal length; Wherein, when the lens moves in each sub-interval, the position information of the lens is determined using the position detection relationship of the sub-interval in which the lens is currently located; The step of controlling the lens to move in different sub-intervals according to the target focal length includes: determining target position information of the lens according to the target focal length; When the first position information of the current position of the lens does not match the target position information, a first electrical signal is input to the driving component according to the first position information and the target position information, so that the driving component drives the lens to move; Determine second position information of the lens after movement using a position detection relationship of the sub-interval where the lens is located after movement; When the second position information does not match the target position information, a second electrical signal is input to the driving component according to the second position information and the target position information, so that the driving component drives the lens to continue to move; When the second position information matches the target position information, the driving of the lens to move is stopped.

2. The zoom method according to claim 1, wherein: The N subintervals include a first subinterval and a second subinterval, wherein the first subinterval and the second subinterval are adjacent to each other and have an overlapping area; When the controller controls the driving assembly to drive the lens to move from the first sub-interval to the second sub-interval, then: Before the lens moves to a preset position in the overlapping area, determining the first subinterval as the subinterval where the lens is currently located; After the lens moves to the preset position in the overlapping area, the second sub-interval is determined to be the sub-interval where the lens is currently located.

3. The zoom method according to claim 2, wherein: The preset position is the end position of the overlapping area, and the lens moves out of the overlapping area at the end position.

4. The zoom method according to claim 1, wherein: The position detection module includes a Hall sensor module and an analog-to-digital conversion module, and the position detection relationship of each sub-interval includes the configuration parameters of the analog-to-digital conversion module corresponding to the sub-interval, and the corresponding relationship between the digital signal output by the analog-to-digital conversion module corresponding to the sub-interval and the position information of the lens; The determining of the second position information of the lens after movement by using the position detection relationship of the sub-interval where the lens is located after movement includes: Determining the target subinterval where the lens is located after the movement based on the position indication information of the lens detected by the Hall sensor module and the preset correspondence between the position indication information and the subinterval; the position indication information is used to indicate the position information of the lens after the movement; Processing the position indication information by the analog-to-digital conversion module using a first configuration parameter of the analog-to-digital conversion module corresponding to the target sub-interval, and outputting a first digital signal; The second position information corresponding to the first digital signal is determined according to the correspondence between the digital signal output by the analog-to-digital conversion module corresponding to the target sub-interval and the position information of the lens.

5. The zoom method according to claim 4, wherein: The driving assembly includes a motor; the Hall sensor module includes: a Hall magnet and a Hall coil, the Hall magnet is fixedly connected to the lens; the position indication information is an electrical signal output by the Hall coil; Driving the lens to move by the driving assembly includes: Drive the lens and the Hall magnet to move by the motor; The determining, based on the position indication information of the lens detected by the Hall sensor module and the preset correspondence between the position indication information and the sub-intervals, the target sub-interval where the lens is located after the movement includes: When the Hall magnet moves, a third electrical signal is output to the analog-to-digital conversion module through the Hall coil; The target sub-interval corresponding to the third electrical signal is determined according to a preset correspondence between the electrical signal output by the Hall coil and the sub-interval where the lens is located.

6. The zoom method according to claim 5, wherein: The analog-to-digital conversion module includes: a primary amplifier, a secondary amplifier, a bias device and an analog-to-digital converter; The input end of the first-stage amplifier is connected to the Hall coil, the output end of the first-stage amplifier is connected to the input end of the second-stage amplifier, the output end of the second-stage amplifier is connected to the input end of the bias device, and the output end of the bias device is connected to the input end of the analog-to-digital converter; The first configuration parameters include: an amplification factor of the first-stage amplifier, an amplification factor of the second-stage amplifier, and a bias factor of the bias device; The processing of the position indication information by the analog-to-digital conversion module using the first configuration parameter of the analog-to-digital conversion module corresponding to the target sub-interval and outputting the first digital signal includes: The third electrical signal is processed by the first-stage amplifier, the second-stage amplifier and the bias device, and the first digital signal is outputted by the analog-to-digital converter.

7. The zoom method according to any one of claims 4 to 6, characterized in that: The N subintervals include a first subinterval and a second subinterval, wherein the first subinterval and the second subinterval are adjacent to each other and have an overlapping area; The determining, based on the position indication information of the lens detected by the Hall sensor module and the preset correspondence between the position indication information and the sub-intervals, the target sub-interval where the lens is located after the movement includes: When the position indication information of the lens detected by the Hall sensor module matches the position indication information corresponding to the first sub-interval, the target sub-interval is determined to be the first sub-interval; the position indication information corresponding to the first sub-interval includes the position indication information of the lens detected by the Hall sensor module when the lens is located at any position between the first endpoint and the preset position of the first sub-interval, and the first endpoint is not within the overlapping area; When the position indication information of the lens detected by the Hall sensor module matches the position indication information corresponding to the second sub-interval, the target sub-interval is determined to be the second sub-interval; the position indication information corresponding to the second sub-interval includes the position indication information of the lens detected by the Hall sensor module when the lens is located at any position between the preset position and the second endpoint of the second sub-interval, and the second endpoint is not within the overlapping area; The preset position is a position in the overlapping area.

8. The zoom method according to any one of claims 4 to 7, characterized in that: The N subintervals include a third subinterval and a fourth subinterval; the third subinterval includes a third endpoint and a fourth endpoint; The fourth subinterval includes the fifth endpoint and the sixth endpoint; Before determining the target position information of the lens according to the target focal length, the method further includes: When the lens is located at the third endpoint, the fourth electrical signal is processed by the analog-to-digital conversion module using the second configuration parameters to output a second digital signal; When the lens is located at the fourth endpoint, the analog-to-digital conversion module processes the fifth electrical signal using the second configuration parameter to output a third digital signal; When the lens is located at the fifth endpoint, the analog-to-digital conversion module processes the sixth electrical signal using the third configuration parameter to output a fourth digital signal; When the lens is located at the sixth endpoint, the analog-to-digital conversion module processes the seventh electrical signal using the third configuration parameter to output a fifth digital signal; The absolute value of the first difference and the absolute value of the second difference are not less than the difference of the preset digital signal range; wherein the first difference is the difference between the second digital signal and the third digital signal; and the second difference is the difference between the fourth digital signal and the fifth digital signal.

9. The zoom method according to claim 8, wherein: The correspondence between the digital signal output by the analog-to-digital conversion module corresponding to the third sub-interval and the position information of the lens includes the following features: The second digital signal corresponds to the position information of the third endpoint; The third digital signal corresponds to the position information of the fourth endpoint; The correspondence between the digital signal output by the analog-to-digital conversion module corresponding to the fourth sub-interval and the position information of the lens includes the following features: The fourth digital signal corresponds to the position information of the fifth endpoint; The fifth digital signal corresponds to the position information of the sixth endpoint.

10. The zoom method according to any one of claims 1 to 9, characterized in that: The union of the N sub-intervals is not smaller than the working interval of the lens.

11. A camera module, characterized in that: The camera module includes a lens, a driving component, a position detection module, a controller and a memory; The controller is connected to the driving component and the position detection module respectively; The controller is configured to obtain a target focal length and send control information to the driving component according to the target focal length; The driving component is configured to drive the lens to move within a working range under the control of the control information; wherein the working range includes N subranges, where N is an integer greater than or equal to 2, and each subrange is smaller than the working range; each subrange corresponds to a position detection relationship, and the position detection relationship is used to define the ability of each digital signal output by the position detection module to represent the movement distance of the lens within the subrange; The controller is further configured to determine the position information of the lens using the position detection relationship of the sub-interval in which the lens is currently located when the lens moves in each sub-interval; The controller is specifically configured to: determine target position information of the lens according to the target focal length, and input a first electrical signal to the driving component according to the first position information and the target position information when first position information of the current position of the lens does not match the target position information; The driving component is specifically configured to: drive the lens to move using the first electrical signal; The controller is further configured to: determine second position information of the lens after movement using a position detection relationship of the sub-interval where the lens is located after movement; when the second position information does not match the target position information, input a second electrical signal to the drive component based on the second position information and the target position information; and when the second position information matches the target position information, send a stop driving signal to the drive component; The driving component is further configured to: after receiving the second electrical signal, use the second electrical signal to drive the lens to continue moving; and after receiving the driving stop information, stop driving the lens to move.

12. The camera module according to claim 11, wherein: The N subintervals include a first subinterval and a second subinterval, wherein the first subinterval and the second subinterval are adjacent to each other and have an overlapping area; The driving component is specifically configured to: drive the movement from the first sub-interval to the second sub-interval under the control of the control information; The controller is further configured to: determine, before the lens moves to a preset position in the overlapping area, the first subinterval as the subinterval in which the lens is currently located; and determine, after the lens moves to the preset position in the overlapping area, the second subinterval as the subinterval in which the lens is currently located.

13. The camera module according to claim 12, wherein: The preset position is the end position of the overlapping area, and the lens moves out of the overlapping area at the end position.

14. The camera module according to claim 11, wherein: The position detection module includes a Hall sensor module and an analog-to-digital conversion module, and the controller is connected to the Hall sensor module and the analog-to-digital conversion module respectively; the position detection relationship of each sub-interval includes the configuration parameters of the analog-to-digital conversion module corresponding to the sub-interval, and the correspondence between the digital signal output by the analog-to-digital conversion module corresponding to the sub-interval and the position information of the lens; The controller is specifically configured to: when the driving component drives the lens to move using the first electrical signal, obtain position indication information of the lens detected by the Hall sensor module; determine, based on the position indication information and a preset correspondence between the position indication information and the sub-intervals, a target sub-interval where the lens is located after movement; and send a first configuration parameter of the analog-to-digital conversion module corresponding to the target sub-interval to the analog-to-digital conversion module; the position indication information is used to indicate position information of the lens after movement; The analog-to-digital conversion module is configured to process the position indication information using a first configuration parameter of the analog-to-digital conversion module corresponding to the target sub-interval and output a first digital signal; The controller is further configured to obtain the first digital signal, and determine the second position information corresponding to the first digital signal based on a correspondence between a digital signal output by an analog-to-digital conversion module corresponding to the target sub-interval and the position information of the lens.

15. The camera module according to claim 14, wherein: The driving assembly includes a motor; the Hall sensor module includes a Hall magnet and a Hall coil, and the Hall magnet is fixedly connected to the lens; The driving assembly is specifically used to: drive the lens and the Hall magnet to move through the motor; The Hall coil is configured to output a third electrical signal to the analog-to-digital conversion module when the Hall magnet moves; The analog-to-digital conversion module is configured to process the third electrical signal using the first configuration parameter of the analog-to-digital conversion module corresponding to the target sub-interval and output the first digital signal; The controller is specifically configured to obtain the third electrical signal and determine the target sub-interval corresponding to the third electrical signal based on a preset correspondence between the electrical signal output by the Hall coil and the sub-interval where the lens is located.

16. The camera module according to claim 15, wherein: The analog-to-digital conversion module includes: a primary amplifier, a secondary amplifier, a bias device, and an analog-to-digital converter; the input end of the primary amplifier is connected to the Hall coil, the output end of the primary amplifier is connected to the input end of the secondary amplifier, the output end of the secondary amplifier is connected to the input end of the bias device, and the output end of the bias device is connected to the input end of the analog-to-digital converter; The first configuration parameters include: an amplification factor of the first-stage amplifier, an amplification factor of the second-stage amplifier, and a bias factor of the bias device; The analog-to-digital conversion module is specifically configured to process the third electrical signal through the first-stage amplifier, the second-stage amplifier, and the bias device, and output the first digital signal.

17. The camera module according to any one of claims 14 to 16, wherein: The N subintervals include a first subinterval and a second subinterval, wherein the first subinterval and the second subinterval are adjacent to each other and have an overlapping area; The controller is specifically configured to: obtain position indication information of the lens detected by the Hall sensor module, and when the position indication information matches the position indication information corresponding to the first sub-interval, determine that the target sub-interval is the first sub-interval; the position indication information corresponding to the first sub-interval includes the position indication information of the lens detected by the Hall sensor module when the lens is located at any position between the first endpoint and the preset position of the first sub-interval, and the first endpoint is not within the overlapping area; when the position indication information matches the position indication information corresponding to the second sub-interval, determine that the target sub-interval is the second sub-interval; the position indication information corresponding to the second sub-interval includes the position indication information of the lens detected by the Hall sensor module when the lens is located at any position between the preset position and the second endpoint of the second sub-interval, and the second endpoint is not within the overlapping area; The preset position is a position in the overlapping area.

18. The camera module according to any one of claims 14 to 17, wherein: The N subintervals include a third subinterval and a fourth subinterval, the third subinterval includes a third endpoint and a fourth endpoint, and the fourth subinterval includes a fifth endpoint and a sixth endpoint; Before determining the target position information of the lens according to the target focal length, the controller is further configured to: send calibration control information to the driving component; The driving component is further configured to: drive the lens to move between the third sub-interval and the fourth sub-interval under the control of the calibration control information; The controller is further configured to: input a second configuration parameter to the analog-to-digital conversion module when the lens moves in the third sub-interval; and input a third configuration parameter to the analog-to-digital conversion module when the lens moves in the fourth sub-interval; The analog-to-digital conversion module is further configured to: when the lens is located at the third endpoint, use the second configuration parameters to process the fourth electrical signal and output a second digital signal; when the lens is located at the fourth endpoint, use the second configuration parameters to process the fifth electrical signal and output a third digital signal; when the lens is located at the fifth endpoint, use the third configuration parameters to process the sixth electrical signal and output a fourth digital signal; when the lens is located at the sixth endpoint, use the third configuration parameters to process the seventh electrical signal and output a fifth digital signal; In which, the absolute value of the first difference and the absolute value of the second difference are not less than the difference of the preset digital signal range; the first difference is the difference between the second digital signal and the third digital signal; and the second difference is the difference between the fourth digital signal and the fifth digital signal.

19. The camera module according to claim 18, wherein: The controller is further configured to establish a correspondence between the digital signal output by the analog-to-digital conversion module corresponding to the third sub-interval and the position information of the lens, and a correspondence between the digital signal output by the analog-to-digital conversion module corresponding to the fourth sub-interval and the position information of the lens; The correspondence between the digital signal output by the analog-to-digital conversion module corresponding to the third sub-interval and the position information of the lens includes the following features: The second digital signal corresponds to the position information of the third endpoint; The third digital signal corresponds to the position information of the fourth endpoint; The correspondence between the digital signal output by the analog-to-digital conversion module corresponding to the fourth sub-interval and the position information of the lens includes the following features: The fourth digital signal corresponds to the position information of the fifth endpoint; The fifth digital signal corresponds to the position information of the sixth endpoint.

20. The camera module according to any one of claims 11 to 19, wherein: The union of the N sub-intervals is not smaller than the working interval of the lens.

21. An electronic device, characterized in that: A camera module comprising a processor and any one of claims 11 to 20; The processor is used to control the camera module.

Citation Information

Patent Citations

  • Lens Position Detector, Lens Barrel and Imaging device

    US20070273364A1