Lens control method and device, electronic equipment and storage medium

By detecting frame synchronization signals and obtaining the dynamic middle-back displacement curve of Hall device, controlling the movement of Hall device, the problem of collision between optical anti-shake when the lens is moving amplitude is large, and the camera module's success rate and protection are improved Shake effect.

CN119110151AActive Publication Date: 2024-12-10BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202310671404.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-07
Publication Date
2024-12-10
Estimated Expiration
2043-06-07

AI Technical Summary

Technical Problem

Optical anti-shake (OIS) is prone to exceed the anti-shake range when the lens moves a large amplitude, causing the lens to bump and fail. It is difficult for the existing technology to effectively solve this problem.

Method used

By detecting the frame synchronization signal, the available back-middle time and dynamic back-middle displacement curve of the Hall device are obtained, and the Hall device is controlled to move to the center position within the reserved back-middle time to avoid collisions and ensure optical anti-shake effect.

Benefits of technology

It effectively avoids lens stuttering, improves the camera module's success rate, enhances the optical anti-shake effect, and solves the problem of insufficient anti-shake range when the lens has a large range of motion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119110151A_ABST
    Figure CN119110151A_ABST
Patent Text Reader

Abstract

The invention relates to a lens control method and device, electronic equipment and a storage medium. The method comprises the following steps: in response to a detected frame synchronization signal, acquiring starting information of a current acquisition period and available return duration of a Hall device; the available centering duration refers to the time for the Hall device to return to the central position in the current acquisition period; determining reserved return time of the current acquisition period according to the starting information and the available return duration; obtaining a dynamic centering displacement curve of the Hall device, wherein the displacement curve represents a mapping relation between each centering moment and a centering step length; and within the reserved centering time, controlling the Hall device to move towards the center position based on the centering step length corresponding to the dynamic centering displacement curve. According to the embodiment of the invention, the Hall device is controlled to move towards the central position within the reserved centering time, so that edge collision of the lens can be avoided, the optical anti-shake effect is ensured, and the photographing success rate of the camera module is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of control technology, and in particular to a lens control method and device, an electronic device, and a storage medium. Background Art

[0002] Currently, Optical Image Stabilization (OIS) achieves an anti-shake effect to improve image clarity by controlling the translation of the lens module to compensate for lens movement in real time. Considering the small size of the lens module and the limited installation volume, OIS usually compensates for an anti-shake range of 1 to 1.5° on each coordinate axis. When the lens moves a large amount, it is easy to exceed the anti-shake range, causing edge collision and causing OIS failure. Summary of the invention

[0003] The present disclosure provides a lens control method and device, an electronic device, and a storage medium to solve the deficiencies of related technologies.

[0004] According to a first aspect of an embodiment of the present disclosure, a lens control method is provided, which is applicable to an electronic device, wherein the electronic device includes a camera module, the camera module includes a lens and a Hall device for adjusting a position of the lens, and the electronic device also includes a gyroscope, and the method includes:

[0005] In response to detecting the frame synchronization signal, the start information of the current acquisition cycle and the available return-to-center time length of the Hall device are obtained; the available return-to-center time length refers to the time taken by the Hall device to return to the center position in the current acquisition cycle;

[0006] Determine the reserved return time of the current acquisition cycle according to the start information and the available return time;

[0007] Acquire a dynamic return-to-center displacement curve of the Hall device, wherein the displacement curve represents a mapping relationship between each return-to-center moment and a return-to-center step length;

[0008] Within the reserved return-to-center time, the Hall device is controlled to move toward the center position based on the return-to-center step length corresponding to the dynamic return-to-center displacement curve.

[0009] Optionally, obtain the available return time of the Hall device, including:

[0010] Get exposure reading data time and exposure time;

[0011] The available return time length corresponding to the current acquisition cycle is calculated according to the current acquisition cycle, the exposure data reading time and the exposure time.

[0012] Optionally, obtaining a dynamic return-to-center displacement curve of the Hall device includes:

[0013] Obtain the initial dynamic return-to-center displacement curve;

[0014] The initial dynamic return-to-center displacement curve is adjusted to obtain a dynamic return-to-center displacement curve.

[0015] Optionally, obtaining an initial dynamic return-to-center displacement curve includes:

[0016] Obtaining the ratio of each centering time to the available centering time; the centering time is greater than or equal to 0 and less than or equal to the available centering time;

[0017] Obtaining a difference between the ratio and a first preset value;

[0018] Obtaining a product of the difference and a second preset value to obtain a first product;

[0019] Obtaining the sine value of the first product;

[0020] The product of the sine value and the third preset value is obtained to obtain a second product, where the second product is the displacement corresponding to each centering moment of the initial dynamic centering displacement curve.

[0021] Optionally, the method further comprises:

[0022] Determine the current state of the Hall device; the current state is one of the following: a first state, a second state, a third state and a fourth state; the first state refers to the state in which the Hall device follows the movement of the gyroscope; the second state refers to the state in which the Hall device is in a continuous edge collision state; the third state refers to the state in which the Hall device is controlled to perform out-of-frame return; the fourth state refers to the state in which the Hall device of the lens module performs out-of-frame return based on the speed data output by the gyroscope;

[0023] When it is determined that the state switching condition is met, the Hall device is controlled to switch from the current state to a next state, and the next state is one of the following: a first state, a second state, a third state, and a fourth state.

[0024] Optionally, when the current state is the third state and the next state is the first state, determining that a state switching condition is satisfied includes:

[0025] Obtain the frame synchronization signal identifier and the distance between the Hall device and the center position;

[0026] When the frame synchronization signal identifier is true, the current frame synchronization signal ends, and the distance is less than a preset distance threshold, it is determined that the state switching condition is met.

[0027] Optionally, when the current state is the third state and the next state is the fourth state, determining that a state switching condition is satisfied includes:

[0028] Acquire the actual displacement change of the Hall device and the return-to-center change of the Hall device; the actual displacement change is the displacement change of the Hall device controlled according to a preset step length, and the return-to-center change is the displacement change of the Hall device controlled according to the speed data of the gyroscope;

[0029] When the actual displacement change is less than or equal to the centering change, it is determined that the state switching condition is met.

[0030] Optionally, when the current state is the fourth state and the next state is the first state, determining that a state switching condition is satisfied includes:

[0031] Obtain the frame synchronization signal identifier and the distance between the Hall device and the center position;

[0032] When the frame synchronization signal identifier is true, the current frame synchronization signal ends, and the distance is less than a preset distance threshold, it is determined that the state switching condition is met.

[0033] Optionally, when the frame synchronization signal identifier is not true, the current frame synchronization signal ends, and the distance is less than a preset distance threshold, the method further includes:

[0034] Get the distance between the Hall device and the center position, the current speed and duration of the gyroscope output;

[0035] When the distance between the Hall device and the center position is less than a preset distance threshold, the current speed is less than a preset speed threshold, and the duration exceeds a duration threshold, it is determined that the state switching condition is met.

[0036] Optionally, when the current state is the second state and the next state is the third state, determining that a state switching condition is satisfied includes:

[0037] Get the frame synchronization signal identifier;

[0038] When the frame synchronization signal flag is true, it is determined that the state switching condition is met.

[0039] Optionally, when the frame synchronization signal identifier is not true, the method further includes:

[0040] Obtaining the number of times the Hall device hits an edge;

[0041] When it is determined that the number of times is greater than a preset number threshold, it is determined that the state switching condition is met.

[0042] Optionally, when the current state is the second state and the next state is the fourth state, determining that a state switching condition is satisfied includes:

[0043] When the frame synchronization signal flag is not true, obtaining the displacement of the Hall device from the center position, the current speed output by the gyroscope, and the number of times the Hall device hits the edge;

[0044] When it is determined that the displacement has a different sign from the current speed and the number of times is greater than a preset number threshold, it is determined that the state switching condition is met.

[0045] Optionally, when the current state is the fourth state and the next state is the second state, determining that a state switching condition is satisfied includes:

[0046] Obtain the displacement of the Hall device from the center position;

[0047] When it is determined that the displacement of the Hall device from the center position exceeds the maximum displacement value, it is determined that the state switching condition is met.

[0048] Optionally, when the current state is the first state and the next state is the second state, determining that a state switching condition is satisfied includes:

[0049] Obtain the displacement of the Hall device from the center position;

[0050] When the displacement of the Hall device from the center position exceeds a preset displacement threshold, it is determined that the state switching condition is met.

[0051] According to a second aspect of an embodiment of the present disclosure, a lens control device is provided, which is suitable for an electronic device, wherein the electronic device includes a camera module, the camera module includes a lens and a Hall device for adjusting the position of the lens, and the electronic device also includes a gyroscope, and the device includes:

[0052] A start signal acquisition module is used to obtain the start information (sof) of the current acquisition cycle in response to detecting the frame synchronization signal.

[0053] An available time acquisition module is used to acquire the available return-to-center time of the Hall device; the available return-to-center time refers to the time taken by the Hall device to return to the center position within the current acquisition cycle;

[0054] A reserved time acquisition module, used to determine the reserved return time of the current acquisition cycle according to the start information and the available return time;

[0055] A mapping relationship acquisition module, used to acquire a dynamic return-to-center displacement curve of the Hall device, wherein the displacement curve represents a mapping relationship between each return-to-center moment and a return-to-center step length;

[0056] The Hall device acquisition module is used to control the Hall device to move toward the center position within the reserved return-to-center time based on the return-to-center step length corresponding to the dynamic return-to-center displacement curve.

[0057] Optionally, the available time acquisition module includes:

[0058] The time acquisition submodule is used to obtain the exposure reading data time and exposure time;

[0059] The duration acquisition submodule is used to calculate the available return duration corresponding to the current acquisition cycle according to the current acquisition cycle, the exposure data reading time and the exposure time.

[0060] Optionally, the mapping relationship acquisition module includes:

[0061] The initial curve acquisition submodule is used to obtain the initial dynamic return displacement curve;

[0062] The dynamic curve acquisition submodule is used to adjust the initial dynamic return-to-center displacement curve to obtain a dynamic return-to-center displacement curve.

[0063] Optionally, the initial curve acquisition submodule includes:

[0064] A ratio acquisition unit, used to acquire a ratio of each centering moment to the available centering time; the centering moment is greater than or equal to 0 and less than or equal to the available centering time;

[0065] A difference obtaining unit, used for obtaining a difference between the ratio and a first preset value;

[0066] A first product obtaining unit, used for obtaining the product of the difference and a second preset value to obtain a first product;

[0067] A sine value acquisition unit, used to acquire the sine value of the first product;

[0068] The displacement acquisition unit is used to acquire the product of the sine value and the third preset value to obtain a second product, where the second product is the displacement corresponding to each centering moment of the initial dynamic centering displacement curve.

[0069] Optionally, the device further comprises:

[0070] A current state determination module is used to determine the current state of the Hall device; the current state is one of the following: a first state, a second state, a third state and a fourth state; the first state refers to the state in which the Hall device follows the movement of the gyroscope; the second state refers to the state in which the Hall device is in a continuous edge collision state; the third state refers to the state in which the Hall device is controlled to perform out-of-frame return; the fourth state refers to the state in which the Hall device of the lens module performs out-of-frame return based on the speed data output by the gyroscope;

[0071] The current state switching module is used to control the Hall device to switch from the current state to the next state when it is determined that the state switching condition is met, and the next state is one of the following: the first state, the second state, the third state and the fourth state.

[0072] Optionally, when the current state is the third state and the next state is the first state, the current state switching module includes:

[0073] The identification acquisition submodule is used to obtain the frame synchronization signal identification and the distance between the Hall device and the center position;

[0074] A distance acquisition submodule is used to obtain the distance between the Hall device and the center position;

[0075] The condition determination submodule is used to determine that the state switching condition is met when the frame synchronization signal identifier is true, the current frame synchronization signal ends, and the distance is less than a preset distance threshold.

[0076] Optionally, when the current state is the third state and the next state is the fourth state, the current state switching module includes:

[0077] The actual displacement acquisition submodule is used to obtain the actual displacement change of the Hall device.

[0078] The back-to-center variation acquisition submodule is used to acquire the back-to-center variation of the Hall device; the actual displacement variation is the displacement variation of the Hall device controlled according to the preset step length, and the back-to-center variation is the displacement variation of the Hall device controlled according to the speed data of the gyroscope;

[0079] The condition determination submodule is used to determine whether the state switching condition is satisfied when the actual displacement change is less than or equal to the return change.

[0080] Optionally, when the current state is the fourth state and the next state is the first state, the current state switching module includes:

[0081] An identification acquisition submodule, used to acquire a frame synchronization signal identification;

[0082] A distance acquisition submodule is used to obtain the distance between the Hall device and the center position;

[0083] The condition determination submodule is used to determine that the state switching condition is met when the frame synchronization signal identifier is true, the current frame synchronization signal ends, and the distance is less than a preset distance threshold.

[0084] Optionally, when the frame synchronization signal identifier is not true, the current frame synchronization signal ends, and the distance is less than a preset distance threshold, the current state switching module further includes:

[0085] A distance acquisition submodule is used to obtain the distance between the Hall device and the center position;

[0086] The speed acquisition submodule is used to obtain the current speed and duration output by the gyroscope;

[0087] The time acquisition submodule is used to obtain the duration;

[0088] The condition determination submodule is used to determine that the state switching condition is met when the distance between the Hall device and the center position is less than a preset distance threshold, the current speed is less than a preset speed threshold, and the duration exceeds a duration threshold.

[0089] Optionally, when the current state is the second state and the next state is the third state, the current state switching module includes:

[0090] An identification acquisition submodule, used to acquire a frame synchronization signal identification;

[0091] The condition determination submodule is used to determine that a state switching condition is met when the frame synchronization signal identifier is true.

[0092] Optionally, when the frame synchronization signal identifier is not true, the current state switching module includes:

[0093] A duration acquisition submodule is used to obtain the number of times the Hall device hits the edge;

[0094] The condition determination submodule is used to determine that the state switching condition is met when it is determined that the number of times is greater than a preset number threshold.

[0095] Optionally, when the current state is the second state and the next state is the fourth state, the current state switching module includes:

[0096] A data acquisition submodule, used for acquiring the displacement of the Hall device from the center position, the current speed output by the gyroscope, and the number of times the Hall device hits the edge when the frame synchronization signal flag is not true;

[0097] The condition determination submodule is used to determine that the state switching condition is satisfied when it is determined that the signs of the displacement and the current speed are different and the number of times is greater than a preset number threshold.

[0098] Optionally, when the current state is the fourth state and the next state is the second state, the current state switching module includes:

[0099] The displacement acquisition submodule is used to obtain the displacement between the Hall device and the center position;

[0100] The condition determination submodule is used to determine whether the state switching condition is met when it is determined that the displacement of the Hall device from the center position exceeds the maximum displacement value.

[0101] Optionally, when the current state is the first state and the next state is the second state, the current state switching module includes:

[0102] The displacement acquisition submodule is used to obtain the displacement between the Hall device and the center position;

[0103] The condition determination submodule is used to determine whether a state switching condition is met when the displacement of the Hall device from the center position exceeds a preset displacement threshold.

[0104] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:

[0105] A camera module and a lens module; the interface of the camera module is electrically connected to the hardware synchronization signal pin of the lens module;

[0106] Memory and processor;

[0107] The memory is used to store a computer program executable by the processor;

[0108] The processor is used to execute the computer program in the memory to implement the method as described in any one of the first aspects.

[0109] According to a fourth aspect of an embodiment of the present disclosure, a non-transitory computer-readable storage medium is provided, and when an executable computer program in the storage medium is executed by a processor, the method described in any one of the first aspects can be implemented.

[0110] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:

[0111] The solution provided by the embodiment of the present disclosure can obtain the starting information of the current acquisition cycle and the available return-to-center time of the Hall device in response to the detection of the frame synchronization signal; the available return-to-center time refers to the time taken by the Hall device to return to the center position within the current acquisition cycle; then, the reserved return-to-center time of the current acquisition cycle is determined according to the starting information and the available return-to-center time; thereafter, the dynamic return-to-center displacement curve of the Hall device is obtained, and the displacement curve characterizes the mapping relationship between each return-to-center moment and the return-to-center step length; finally, within the reserved return-to-center time, the Hall device is controlled to move to the center position based on the return-to-center step length corresponding to the dynamic return-to-center displacement curve. In this way, by controlling the Hall device to move to the center position within the reserved return-to-center time, this embodiment can avoid the lens from hitting the edge, ensure the optical image stabilization effect, and improve the success rate of the camera module taking pictures.

[0112] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0113] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0114] Figure 1 The figure is a flowchart of a lens control method according to an exemplary embodiment.

[0115] Figure 2 The diagram is a schematic diagram of a frame synchronization signal according to an exemplary embodiment.

[0116] Figure 3 The present invention is a flowchart showing a method of obtaining available return time according to an exemplary embodiment.

[0117] Figure 4 The present invention is a flow chart showing a method for obtaining a dynamic return-to-center displacement curve according to an exemplary embodiment.

[0118] Figure 5 The diagram is a schematic diagram showing speed matching between a Hall device and a gyroscope according to an exemplary embodiment.

[0119] Figure 6 The diagram is a logic diagram of state switching of a Hall device according to an exemplary embodiment.

[0120] Figure 7 The invention is a block diagram of a lens control device according to an exemplary embodiment.

[0121] Figure 8 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0122] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described exemplarily below do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices consistent with some aspects of the present disclosure as detailed in the attached claims. It should be noted that the features in the following embodiments and implementations may be combined with each other without conflict.

[0123] To solve the above technical problems, the embodiments of the present disclosure provide a lens control method and device, an electronic device, and a storage medium. The lens control method can be applied to an electronic device, and the electronic device can include a camera module. The camera module includes a lens and a Hall device for adjusting the position of the lens.

[0124] In one example, the lens may include a wide-angle lens (WIDE) and / or an ultra-wide-angle lens (UW). Taking the wide-angle lens as an example, it includes a hardware synchronization signal pin. In this example, the hardware synchronization signal pin of the wide-angle lens can be electrically connected to the interface of the camera module. Specifically, the hardware synchronization signal pin of the wide-angle lens can be connected to the vacant GPIO port of the smart sensor hub (Sensorhub) of the camera module through a wire, so that the camera module can receive the frame synchronization signal (Vsync) output by the wide-angle lens. It is understandable that the processing method is similar when the lens is an ultra-wide-angle lens or other lens. In addition, when the number of lenses is multiple, the smart sensor hub of the camera module can be connected to the hardware synchronization signal pin of one of the lenses, and the solution is simple and easy to implement.

[0125] It should be noted that the wide-angle lens will send a frame synchronization signal (Vsync) according to a preset image acquisition cycle. Taking the frame rate as 30fps as an example, the preset image acquisition cycle is (1 / 30=)33ms. In other words, the preset image acquisition cycle can be adjusted according to the frame rate of the camera module, which is not limited here.

[0126] In one embodiment, after receiving the frame synchronization signal, the processor of the camera module will preferentially process the frame synchronization signal as an interrupt event, that is, the camera module preferentially executes the lens control method provided by the present disclosure.

[0127] In this embodiment, the electronic device further includes a gyroscope, which can detect the spatial posture of the electronic device and output speed data of the electronic device (hereinafter also referred to as the current speed). The speed data can control the movement of the Hall device in some states to achieve the effect of adjusting the focal length of the lens.

[0128] Based on the above electronic device, the embodiment of the present disclosure further provides a lens control method. Figure 1 is a flowchart of a lens control method according to an exemplary embodiment. Figure 1 , a lens control method, comprising steps 11 to 14.

[0129] In step 11, in response to detecting the frame synchronization signal, the start information of the current acquisition cycle and the available return-to-center time of the Hall device are obtained; the available return-to-center time refers to the time taken by the Hall device to return to the center position in the current acquisition cycle.

[0130] In this step, after the camera module of the electronic device detects the frame synchronization signal, it can obtain the starting information of the current acquisition cycle. Among them, the camera module captures the preview image according to the pre-configured configuration information. The above configuration information includes the frame rate, which refers to the number of images captured by the camera module within 1 second. In other words, since each acquisition cycle is in a reciprocal relationship with the frame rate, after the frame rate is obtained, the reciprocal of the frame rate can be used as the length of each acquisition cycle.

[0131] It is understandable that each acquisition cycle includes a start time, a duration, and an end time. In one example, the camera module can use the start time of each acquisition cycle as the above-mentioned start information (Start of Frame, SOF). Since the frame synchronization signal (Vsync) is located at the front of each acquisition cycle, the frame synchronization signal is used as the above-mentioned start information in this example. The camera module can obtain the frame synchronization signal sent by the lens, and the time when the frame synchronization signal is received can be used as the above-mentioned start information.

[0132] See also Figure 2 , each acquisition cycle includes a frame synchronization signal. In one example, the frame synchronization signal can be a pulse signal, and the pulse signal includes a rising edge and a falling edge, and the rising edge or the falling edge can be selected as a valid trigger signal. In this example, the falling edge of the pulse signal is selected as the valid trigger signal.

[0133] In this step, the camera module can obtain the available return time Tsync of the Hall device in the camera module, see Figure 3 , including steps 31 to 32.

[0134] In step 31, the exposure data reading time and the exposure time are obtained.

[0135] In this step, the electronic device stores configuration information, which includes the camera exposure readout time Trot (readout time) and the camera exposure time Texp (Exposure). The camera module can read the above configuration information from a specified location (local memory, cache, etc.) to obtain the exposure readout time and exposure time.

[0136] In step 32, the available return time length corresponding to the current acquisition cycle is calculated according to the current acquisition cycle, the exposure data reading time and the exposure time.

[0137] In this step, the camera module can calculate the available centering time corresponding to the current acquisition cycle based on the current acquisition cycle, exposure reading time and exposure time. The calculation formula of the available centering time is shown in formula (1).

[0138]

[0139] Taking the frame rate as 30fps as an example, the exposure reading time Trot = 10ms, the exposure time Texp = 10ms, and combined with formula (1), we can know that:

[0140] It is understandable that the above available return time refers to the time required for the Hall device to return to the middle position (i.e. return to the center) within the current acquisition cycle. The above middle position refers to the default position of the Hall device. The Hall device can move forward or backward in a certain direction starting from the middle position. The movement range is [-B, B], and B (i.e. Bonud) is the maximum displacement.

[0141] In step 12, the reserved return time of the current acquisition cycle is determined according to the start information and the available return time.

[0142] In this step, the camera module can determine the reserved centering time of the current acquisition cycle according to the start information and the available centering time, that is, taking the start signal as the starting point and the available centering time as the duration to determine the reserved centering time of the Hall device in the current acquisition barber shop. In other words, the camera module can control the Hall device to perform centering movement within the reserved centering time after receiving the frame synchronization signal.

[0143] In step 13, a dynamic return-to-center displacement curve of the Hall device is obtained, wherein the displacement curve represents a mapping relationship between each return-to-center moment and a return-to-center step length.

[0144] In this step, the camera module can obtain the dynamic return displacement curve of the Hall device, see Figure 4 , including steps 41 to 42.

[0145] In step 41, an initial dynamic return-to-center displacement curve is obtained.

[0146] In this step, the camera module can obtain the initial dynamic return-to-center displacement curve, including: the ratio of each return-to-center moment to the available return-to-center duration (Tsync) can be obtained, and the return-to-center moment is greater than or equal to 0 and less than or equal to the return-to-center duration. Since the value range of the return-to-center moment is [0, Tsync], the ratio can be understood as the relative position of the return-to-center moment in the value range [0, Tsync]. Then, the difference between the above ratio and the first preset value is obtained. The first preset value can be 0.25. Afterwards, the product of the above difference and the second preset value is obtained to obtain the first product. The second preset value can be 2π. Furthermore, the sine value of the first product can be obtained. Finally, the product of the sine value and the third preset value can be obtained to obtain the second product, and the second product is the displacement corresponding to each return-to-center moment of the initial dynamic return-to-center displacement curve. The third preset value can be 0.05.

[0147] In step 42, the initial dynamic return-to-center displacement curve is adjusted to obtain a dynamic return-to-center displacement curve. For example, a third preset value is added to each displacement of the initial dynamic return-to-center displacement curve.

[0148] In this step, the expression of the dynamic return displacement curve is shown in formula (2).

[0149] offset=0.05*sin(2π*(x / T sync -0.25))+0.05. (2)

[0150] In formula (2), x represents the centering time, and its value range is [0, Tsync], Tsync represents the available centering time, and offset represents the offset displacement.

[0151] It should be noted that formula (2) illustrates a scenario for obtaining a normalized back-to-center step length, that is, the size of the back-to-center step length is within [0, 1]. In practice, the value of the third preset value in formula (2) can be adjusted, such as the actual step length change rate (center_ratio) in the subsequent embodiments, so that the calculated step length can be used directly. Of course, the above-mentioned normalized step length can also be multiplied by the actual step length change rate (center_ratio) to obtain the actual back-to-center step length, and the Hall device can be controlled to move within the range of [-B, B] according to the above-mentioned actual back-to-center step length.

[0152] In step 14, within the reserved return-to-center time, the Hall device is controlled to move toward the center position based on the return-to-center step length corresponding to the dynamic return-to-center displacement curve.

[0153] In this step, within the reserved return-to-center time, the camera module can control the Hall device to move toward the center position based on the return-to-center step length corresponding to the dynamic return-to-center displacement curve, and the effect is as follows: Figure 5 See Figure 5 Curve 2 represents the displacement of the Hall device, curve 1 represents the differential curve of the Hall device, that is, the velocity curve, and curve 3 represents the velocity data output by the gyroscope. At the three positions of point P, the speed of the Hall device is very close to the output speed of the gyroscope, which means that it has a good anti-shake effect.

[0154] In this way, this embodiment can avoid the lens from hitting the edge (that is, the displacement of the lens is outside the Bound) by controlling the Hall device to move toward the center position within the reserved return time, thereby ensuring the optical image stabilization effect and improving the success rate of the camera module taking pictures.

[0155] In one embodiment, the camera module can embed the above-mentioned centering process into the state machine, so as to globally perform centering compensation on the Hall device. Figure 6shown.

[0156] The camera module can receive the frame positive signal and initialize. The initialization process includes but is not limited to updating the count times or timing duration, frame synchronization signal flag, and actual step change rate (center_ratio). After initialization, the camera module can enter the return processing. The specific process is as follows Figure 1 The example scenario.

[0157] The camera module can determine the current state of the Hall device, which is one of the following: the first state, the second state, the third state and the fourth state; the first state refers to the state in which the Hall device follows the movement of the gyroscope; the second state refers to the state in which the Hall device is in a continuous edge collision state; the third state refers to the state in which the Hall device is controlled to perform out-of-frame return; the fourth state refers to the state in which the Hall device of the lens module performs out-of-frame return based on the speed data output by the gyroscope.

[0158] Then, the camera module obtains the parameter data and determines whether the state switching condition is met according to the parameter data. When it is determined that the state switching condition is not met, the current state is maintained. When it is determined that the state switching condition is met, the Hall device is controlled to switch from the current state to the next state, and the next state is one of the following: the first state, the second state, the third state and the fourth state.

[0159] See also Figure 6 , the current state is the first state and the next state is the second state, the camera module determines that the state switching condition is met, including: the camera module can obtain the displacement of the Hall device and the middle position. When the displacement of the Hall device and the middle position is greater than or equal to the preset displacement position, the camera module can determine that the state switching condition is met, and the camera module controls the Hall device to switch from the first state to the second state. Among them, the preset displacement position can be taken as 0.95B~0.99B. In one example, the preset displacement position is 0.99B.

[0160] Continue to see Figure 6 , the current state is the second state and the next state is the third state, and the camera module determines that the state switching condition is met, including: the camera module can obtain a frame synchronization signal flag. When the frame synchronization signal flag is true, the camera module can determine that the state switching condition is met, and the camera module controls the Hall device to switch from the second state to the third state.

[0161] When the frame synchronization signal flag is not true, the camera module can obtain the number of times the Hall device hits the edge. When the number is determined to be greater than the preset number threshold, the camera module can determine that the state switching condition is met, and the camera module controls the Hall device to switch from the second state to the third state. The value range of the above preset number threshold is 10 to 1000. In one example, the value of the preset number threshold is 100.

[0162] When the frame synchronization signal flag is not true, the camera module can determine the displacement of the Hall device from the center position, the current speed output by the gyroscope, and the number of times the Hall device hits the edge. When it is determined that the number of times is greater than the preset threshold and the displacement has a different sign from the current speed, the camera module can determine that the state switching condition is met, and the camera module controls the Hall device to switch from the second state to the fourth state. Among them, the displacement of the Hall device from the center position and the current speed have different signs, indicating that the Hall device moves toward the center position, that is, it is in the return state, so it switches to the fourth state.

[0163] Continue to see Figure 6 , the current state is the third state and the next state is the first state, the camera module determines that the state switching condition is met, including: the camera module can obtain the frame synchronization signal identifier and the distance between the Hall device and the center position. When the frame synchronization signal is true, the distance is less than the preset distance threshold and the current frame synchronization signal ends, the camera module can determine that the state switching condition is met. At this time, the camera module controls the Hall device to switch from the third state to the first state. Among them, the end of this frame synchronization signal can be understood as the end of the current acquisition cycle. The value range of the above-mentioned preset distance threshold is 0.01B~0.1B. In one example, the above-mentioned preset distance threshold is 0.05B.

[0164] Continue to see Figure 6 , the current state is the third state and the next state is the fourth state, the camera module determines that the state switching condition is met, including: the camera module can obtain the actual displacement change of the Hall device and the return to center change of the Hall device; the above-mentioned actual displacement change is the displacement change of the Hall device controlled according to the preset step length, and the return to center change is the displacement change of the Hall device controlled according to the speed data of the gyroscope. When the above-mentioned actual displacement change is less than or equal to the above-mentioned return to center change, the camera module can determine that the state switching condition is met, and at this time the camera module controls the Hall device to switch from the third state to the fourth state.

[0165] It should be noted that in the third state, the Hall device is in an active return to center state. At this time, the Hall device moves to the center position according to the control of the return to center step, that is, the Hall device does not move following the speed data output by the gyroscope. This process can obtain the actual displacement change of the Hall device. However, the camera module still calculates the displacement change of the Hall device (that is, the above-mentioned return to center change) based on the speed data output by the gyroscope. In the early stage of the third state, the actual displacement change is greater than the return to center change. In theory, at a certain moment, there is a scene where the actual displacement change is equal to the return to center change, indicating that the effect of controlling the Hall device to move to the center position according to the return to center step is the same as the effect of following the gyroscope to move to the center position. Continuing to the next moment, the actual displacement change is less than the return to center change. At this time, the effect of following the gyroscope to move to the center position is better than the effect of controlling the Hall device to move to the center position according to the return to center step. At this time, the state of following the gyroscope to move to the center position can be switched, that is, the fourth state.

[0166] Continue to see Figure 6 , the current state is the fourth state and the next state is the first state, the camera module determines that the state switching condition is met, including: the camera module can obtain the frame synchronization signal identifier and the distance between the Hall device and the center position. Then, when the frame synchronization signal identifier is true, the current frame synchronization signal ends, and the distance is less than the preset distance threshold, the camera module can determine that the state switching condition is met, and the camera module controls the Hall device to switch from the fourth state to the first state.

[0167] When the frame synchronization signal identifier is not true, the current frame synchronization signal ends, and the distance is less than the preset distance threshold, the camera module can obtain the distance between the Hall device and the center position, the current speed and duration output by the gyroscope; when the distance between the Hall device and the center position is less than the preset distance threshold, the current speed is less than the preset speed threshold, and the duration exceeds the duration threshold, it is determined that the state switching condition is met, and the camera module controls the Hall device to switch from the fourth state to the first state.

[0168] Continue to see Figure 6 , the current state is the fourth state and the next state is the second state, the camera module determines that the state switching condition is met, including: the camera module can obtain the displacement of the Hall device and the center position. When the displacement of the Hall device and the center position exceeds the preset displacement threshold, it is determined that the state switching condition is met, and the camera module controls the Hall device to switch from the fourth state to the first state.

[0169] In this embodiment, by Figure 1The illustrated solution is nested in the state machine to ensure the maximum return to center while ensuring that the speed of the Hall device can be continuous and stable. In addition, the solution of this embodiment can increase the anti-shake range in small frame jitter scenarios, alleviate the edge collision phenomenon, ensure the anti-shake effect, and increase the success rate of the camera module output image by about 30%. In addition, the solution of this embodiment can also solve the image drift problem caused by the use of filters and eliminate temperature drift errors.

[0170] It should be noted that Figure 6 The priority of the state switching shown by the dotted line is higher than the priority of the state switching shown by the solid line. Taking the switching from the second state to the third state as an example, the priority of the switching condition where the frame synchronization signal is marked as true is higher than the priority of the number of edge collisions greater than the preset number threshold. In this way, the embodiment of the present disclosure can enrich the state switching path of the state machine and improve the control accuracy of the Hall device.

[0171] Based on a lens control method provided in an embodiment of the present disclosure, an embodiment of the present disclosure further provides a lens control device, which is suitable for an electronic device, wherein the electronic device includes a camera module, the camera module includes a lens and a Hall device for adjusting the position of the lens, and the electronic device also includes a gyroscope, see Figure 7 , the device comprises:

[0172] The start signal acquisition module 71 is used to obtain the start information (sof) of the current acquisition cycle in response to detecting the frame synchronization signal.

[0173] The available time acquisition module 72 is used to acquire the available return time of the Hall device; the available return time refers to the time taken by the Hall device to return to the center position in the current acquisition cycle;

[0174] A reserved time acquisition module 73, used to determine the reserved return time of the current acquisition cycle according to the start information and the available return time length;

[0175] A mapping relationship acquisition module 74, used to acquire a dynamic return-to-center displacement curve of the Hall device, wherein the displacement curve represents a mapping relationship between each return-to-center moment and a return-to-center step length;

[0176] The Hall device acquisition module 75 is used to control the Hall device to move toward the center position within the reserved return-to-center time based on the return-to-center step length corresponding to the dynamic return-to-center displacement curve.

[0177] Optionally, the available time acquisition module includes:

[0178] The time acquisition submodule is used to obtain the exposure reading data time and exposure time;

[0179] The duration acquisition submodule is used to calculate the available return duration corresponding to the current acquisition cycle according to the current acquisition cycle, the exposure data reading time and the exposure time.

[0180] Optionally, the mapping relationship acquisition module includes:

[0181] The initial curve acquisition submodule is used to obtain the initial dynamic return displacement curve;

[0182] The dynamic curve acquisition submodule is used to adjust the initial dynamic return-to-center displacement curve to obtain a dynamic return-to-center displacement curve.

[0183] Optionally, the initial curve acquisition submodule includes:

[0184] A ratio acquisition unit, used to acquire a ratio of each centering moment to the available centering time; the centering moment is greater than or equal to 0 and less than or equal to the available centering time;

[0185] A difference obtaining unit, used for obtaining a difference between the ratio and a first preset value;

[0186] A first product obtaining unit, used for obtaining the product of the difference and a second preset value to obtain a first product;

[0187] A sine value acquisition unit, used to acquire the sine value of the first product;

[0188] The displacement acquisition unit is used to acquire the product of the sine value and the third preset value to obtain a second product, where the second product is the displacement corresponding to each centering moment of the initial dynamic centering displacement curve.

[0189] Optionally, the device further comprises:

[0190] A current state determination module is used to determine the current state of the Hall device; the current state is one of the following: a first state, a second state, a third state and a fourth state; the first state refers to the state in which the Hall device follows the movement of the gyroscope; the second state refers to the state in which the Hall device is in a continuous edge collision state; the third state refers to the state in which the Hall device is controlled to perform out-of-frame return; the fourth state refers to the state in which the Hall device of the lens module performs out-of-frame return based on the speed data output by the gyroscope;

[0191] The current state switching module is used to control the Hall device to switch from the current state to the next state when it is determined that the state switching condition is met, and the next state is one of the following: the first state, the second state, the third state and the fourth state.

[0192] Optionally, when the current state is the third state and the next state is the first state, the current state switching module includes:

[0193] The identification acquisition submodule is used to obtain the frame synchronization signal identification and the distance between the Hall device and the center position;

[0194] A distance acquisition submodule is used to obtain the distance between the Hall device and the center position;

[0195] The condition determination submodule is used to determine that the state switching condition is met when the frame synchronization signal identifier is true, the current frame synchronization signal ends, and the distance is less than a preset distance threshold.

[0196] Optionally, when the current state is the third state and the next state is the fourth state, the current state switching module includes:

[0197] The actual displacement acquisition submodule is used to obtain the actual displacement change of the Hall device.

[0198] The back-to-center variation acquisition submodule is used to acquire the back-to-center variation of the Hall device; the actual displacement variation is the displacement variation of the Hall device controlled according to the preset step length, and the back-to-center variation is the displacement variation of the Hall device controlled according to the speed data of the gyroscope;

[0199] The condition determination submodule is used to determine that the state switching condition is met when the actual displacement change is less than or equal to the return change.

[0200] Optionally, when the current state is the fourth state and the next state is the first state, the current state switching module includes:

[0201] An identification acquisition submodule is used to acquire a frame synchronization signal identification;

[0202] A distance acquisition submodule is used to obtain the distance between the Hall device and the center position;

[0203] The condition determination submodule is used to determine that the state switching condition is met when the frame synchronization signal identifier is true, the current frame synchronization signal ends, and the distance is less than a preset distance threshold.

[0204] Optionally, when the frame synchronization signal identifier is not true, the current frame synchronization signal ends, and the distance is less than a preset distance threshold, the current state switching module further includes:

[0205] A distance acquisition submodule is used to obtain the distance between the Hall device and the center position;

[0206] The speed acquisition submodule is used to obtain the current speed and duration output by the gyroscope;

[0207] The time acquisition submodule is used to obtain the duration;

[0208] The condition determination submodule is used to determine that the state switching condition is met when the distance between the Hall device and the center position is less than a preset distance threshold, the current speed is less than a preset speed threshold, and the duration exceeds a duration threshold.

[0209] Optionally, when the current state is the second state and the next state is the third state, the current state switching module includes:

[0210] An identification acquisition submodule, used to acquire a frame synchronization signal identification;

[0211] The condition determination submodule is used to determine that a state switching condition is met when the frame synchronization signal identifier is true.

[0212] Optionally, when the frame synchronization signal identifier is not true, the current state switching module includes:

[0213] A duration acquisition submodule is used to obtain the number of times the Hall device hits the edge;

[0214] The condition determination submodule is used to determine that the state switching condition is met when it is determined that the number of times is greater than a preset number threshold.

[0215] Optionally, when the current state is the second state and the next state is the fourth state, the current state switching module includes:

[0216] A data acquisition submodule, used for acquiring the displacement of the Hall device from the center position, the current speed output by the gyroscope, and the number of times the Hall device hits the edge when the frame synchronization signal flag is not true;

[0217] The condition determination submodule is used to determine that the state switching condition is satisfied when it is determined that the signs of the displacement and the current speed are different and the number of times is greater than a preset number threshold.

[0218] Optionally, when the current state is the fourth state and the next state is the third state, the current state switching module includes:

[0219] The displacement acquisition submodule is used to obtain the displacement between the Hall device and the center position;

[0220] The condition determination submodule is used to determine whether the state switching condition is met when it is determined that the displacement of the Hall device from the center position exceeds the maximum displacement value.

[0221] Optionally, when the current state is the first state and the next state is the second state, the current state switching module includes:

[0222] The displacement acquisition submodule is used to obtain the displacement between the Hall device and the center position;

[0223] The condition determination submodule is used to determine whether a state switching condition is met when the displacement of the Hall device from the center position exceeds a preset displacement threshold.

[0224] It should be noted that the device embodiment shown in this embodiment matches the content of the above method embodiment, and the content of the above method embodiment can be referred to, which will not be repeated here.

[0225] Figure 8 8 is a block diagram of an electronic device according to an exemplary embodiment. For example, the electronic device 800 may be a smart phone, a computer, a digital broadcast terminal, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0226] Reference Figure 8 The electronic device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , a communication component 816 , and an image acquisition component 818 .

[0227] The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute computer programs. In addition, the processing component 802 may include one or more modules to facilitate interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.

[0228] The memory 804 is configured to store various types of data to support operations on the electronic device 800. Examples of such data include computer programs for any application or method operating on the electronic device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0229] The power supply component 806 provides power to various components of the electronic device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 800. The power supply component 806 may include a power supply chip, and the controller may communicate with the power supply chip to control the power supply chip to turn on or off the first switch device, so that the battery supplies power to the mainboard circuit or does not supply power.

[0230] The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the target object. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input information from the target object. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.

[0231] The audio component 810 is configured to output and / or input audio file information. For example, the audio component 810 includes a microphone (MIC), and when the electronic device 800 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive external audio file information. The received audio file information can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio file information.

[0232] The I / O interface 812 provides an interface between the processing component 802 and a peripheral interface module, which may be a keyboard, a click wheel, a button, etc.

[0233] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the electronic device 800. For example, the sensor assembly 814 can detect the open / closed state of the electronic device 800, the relative positioning of components, such as the display and keypad of the electronic device 800, and the sensor assembly 814 can also detect the position change of the electronic device 800 or a component, the presence or absence of contact between the target object and the electronic device 800, the orientation or acceleration / deceleration of the electronic device 800, and the temperature change of the electronic device 800.

[0234] The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G, 5G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives broadcast information or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies. For another example, the electronic device also includes multiple groups of antennas arranged in different positions.

[0235] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components.

[0236] In an exemplary embodiment, the present disclosure also provides a non-transitory computer-readable storage medium, and when an executable computer program in the storage medium is executed by a processor, the above-mentioned method can be implemented.

[0237] In an exemplary embodiment, a chip is also provided, the chip including a processor and an interface for reading a computer program through the interface to implement the above method. The chip may be a conventional CPU (central processing unit) chip, a GPU (graphics processing unit) chip, etc., or an acceleration chip dedicated to artificial intelligence technology, such as an AI (Artificial Intelligence) accelerator, etc.

[0238] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the disclosure disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0239] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A lens control method, characterized in that: Suitable for an electronic device, the electronic device includes a camera module, the camera module includes a lens and a Hall device for adjusting the position of the lens, the electronic device also includes a gyroscope, and the method includes: In response to detecting the frame synchronization signal, the start information of the current acquisition cycle and the available return-to-center time length of the Hall device are obtained; the available return-to-center time length refers to the time taken by the Hall device to return to the center position in the current acquisition cycle; Determine the reserved return time of the current acquisition cycle according to the start information and the available return time; Acquire a dynamic return-to-center displacement curve of the Hall device, wherein the displacement curve represents a mapping relationship between each return-to-center moment and a return-to-center step length; Within the reserved return-to-center time, the Hall device is controlled to move toward the center position based on the return-to-center step length corresponding to the dynamic return-to-center displacement curve.

2. The method according to claim 1, characterized in that Get the available return time of the Hall device, including: Get exposure reading data time and exposure time; The available return time length corresponding to the current acquisition cycle is calculated according to the current acquisition cycle, the exposure data reading time and the exposure time.

3. The method according to claim 1, characterized in that Obtaining a dynamic return-to-center displacement curve of the Hall device, including: Obtain the initial dynamic return-to-center displacement curve; The initial dynamic return-to-center displacement curve is adjusted to obtain a dynamic return-to-center displacement curve.

4. The method according to claim 3, characterized in that Obtain the initial dynamic return displacement curve, including: Obtaining the ratio of each centering moment to the available centering duration; the centering moment is greater than or equal to 0 and less than or equal to the centering duration; Obtaining a difference between the ratio and a first preset value; Obtaining a product of the difference and a second preset value to obtain a first product; Obtaining the sine value of the first product; The product of the sine value and the third preset value is obtained to obtain a second product, where the second product is the displacement corresponding to each centering moment of the initial dynamic centering displacement curve.

5. The method according to claim 1, characterized in that The method further comprises: Determine the current state of the Hall device; the current state is one of the following: a first state, a second state, a third state and a fourth state; the first state refers to the state in which the Hall device follows the movement of the gyroscope; the second state refers to the state in which the Hall device is in a continuous edge collision state; the third state refers to the state in which the Hall device is controlled to perform out-of-frame return; the fourth state refers to the state in which the Hall device of the lens module performs out-of-frame return based on the speed data output by the gyroscope; When it is determined that the state switching condition is met, the Hall device is controlled to switch from the current state to a next state, and the next state is one of the following: a first state, a second state, a third state, and a fourth state.

6. The method according to claim 5, characterized in that When the current state is the third state and the next state is the first state, determining that a state switching condition is satisfied includes: Obtain the frame synchronization signal identifier and the distance between the Hall device and the center position; When the frame synchronization signal identifier is true, the current frame synchronization signal ends, and the distance is less than a preset distance threshold, it is determined that the state switching condition is met.

7. The method according to claim 5, characterized in that When the current state is the third state and the next state is the fourth state, determining that a state switching condition is satisfied includes: Acquire the actual displacement change of the Hall device and the return-to-center change of the Hall device; the actual displacement change is the displacement change of the Hall device controlled according to a preset step length, and the return-to-center change is the displacement change of the Hall device controlled according to the speed data of the gyroscope; When the actual displacement change is less than or equal to the centering change, it is determined that the state switching condition is met.

8. The method according to claim 5, characterized in that When the current state is the fourth state and the next state is the first state, determining that a state switching condition is satisfied includes: Obtain the frame synchronization signal identifier and the distance between the Hall device and the center position; When the frame synchronization signal identifier is true, the current frame synchronization signal ends, and the distance is less than a preset distance threshold, it is determined that the state switching condition is met.

9. The method according to claim 8, characterized in that When the frame synchronization signal identifier is not true, the current frame synchronization signal ends, and the distance is less than a preset distance threshold, the method further includes: Get the distance between the Hall device and the center position, the current speed and duration of the gyroscope output; When the distance between the Hall device and the center position is less than a preset distance threshold, the current speed is less than a preset speed threshold, and the duration exceeds a duration threshold, it is determined that the state switching condition is met.

10. The method according to claim 5, characterized in that When the current state is the second state and the next state is the third state, determining that a state switching condition is satisfied includes: Get the frame synchronization signal identifier; When the frame synchronization signal flag is true, it is determined that the state switching condition is met.

11. The method according to claim 10, characterized in that When the frame synchronization signal identifier is not true, the method further includes: Obtaining the number of times the Hall device hits an edge; When it is determined that the number of times is greater than a preset number threshold, it is determined that the state switching condition is met.

12. The method according to claim 5, characterized in that When the current state is the second state and the next state is the fourth state, determining that a state switching condition is satisfied includes: When the frame synchronization signal flag is not true, obtaining the displacement of the Hall device from the center position, the current speed output by the gyroscope, and the number of times the Hall device hits the edge; When it is determined that the displacement has a different sign from the current speed and the number of times is greater than a preset number threshold, it is determined that the state switching condition is met.

13. The method according to claim 5, characterized in that When the current state is the fourth state and the next state is the second state, determining that a state switching condition is satisfied includes: Obtain the displacement of the Hall device from the center position; When it is determined that the displacement of the Hall device from the center position exceeds the maximum displacement value, it is determined that the state switching condition is met.

14. The method according to claim 5, characterized in that When the current state is the first state and the next state is the second state, determining that a state switching condition is satisfied includes: Obtain the displacement of the Hall device from the center position; When the displacement of the Hall device from the center position exceeds a preset displacement threshold, it is determined that the state switching condition is met.

15. A lens control device, characterized in that: Suitable for electronic equipment, the electronic equipment includes a camera module, the camera module includes a lens and a Hall device for adjusting the position of the lens, the electronic equipment also includes a gyroscope, and the device includes: A start signal acquisition module is used to obtain the start information (sof) of the current acquisition cycle in response to detecting the frame synchronization signal. An available time acquisition module is used to acquire the available return-to-center time of the Hall device; the available return-to-center time refers to the time taken by the Hall device to return to the center position within the current acquisition cycle; A reserved time acquisition module, used to determine the reserved return time of the current acquisition cycle according to the start information and the available return time; A mapping relationship acquisition module, used to acquire a dynamic return-to-center displacement curve of the Hall device, wherein the displacement curve represents a mapping relationship between each return-to-center moment and a return-to-center step length; The Hall device acquisition module is used to control the Hall device to move toward the center position within the reserved return-to-center time based on the return-to-center step length corresponding to the dynamic return-to-center displacement curve.

16. An electronic device, characterized in that: include: A camera module and a lens module; the interface of the camera module is electrically connected to the hardware synchronization signal pin of the lens module; Memory and processor; The memory is used to store a computer program executable by the processor; The processor is used to execute the computer program in the memory to implement the method according to any one of claims 1 to 14.

17. A non-transitory computer-readable storage medium, characterized in that: When the executable computer program in the storage medium is executed by a processor, the method according to any one of claims 1 to 6 can be implemented.

Citation Information

Patent Citations

  • Optical Image Stabilization Module And Camera Module

    CN106921832A

  • Antishake focus lens module and control method thereof

    CN109683428A

  • Optical anti-shake device, magnetic field compensation method, anti-shake control method, and electronic apparatus

    CN115857248A

  • Heating apparatus and method for temperature detection at a heating apparatus

    KR102812436B1