Focusing method, device and equipment and computer readable storage medium

By obtaining the current position of the camera and determining the first start current of the open-loop motor, the shaking problem during the focus of the open-loop motor is solved, reducing the stability time and improving the user experience.

CN119520985APending Publication Date: 2025-02-25GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311066159.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-22
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

When using an open-loop motor to drive the camera for focus, there may be probabilistic shaking when the camera is turned on for the first time, which will affect the user experience.

Method used

By obtaining the position of the camera's current moment, the first starting current of the open-loop motor is determined, and the camera is driven based on the current by using the open-loop motor to focus.

Benefits of technology

Reduces the stabilization time of the open-loop motor, reduces the probability of focus shaking, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119520985A_ABST
    Figure CN119520985A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a focusing method, device and equipment and a computer readable storage medium. The method comprises the steps that the position of a camera at the current moment is acquired; determining a first starting current of an open-loop motor in the camera based on the position of the current moment; and based on the first starting current, using an open-loop motor to drive the camera to focus. Therefore, when the open-loop motor is used for driving the camera to focus, the stabilizing time of the open-loop motor can be shortened, and focusing shaking is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing, and in particular to a focusing method, device, equipment and computer-readable storage medium. Background Art

[0002] With the rapid development of smart terminals (such as mobile phones, tablet computers, etc.), mobile terminals provide more and more help to users in life, work, entertainment, etc. Among them, the shooting function has become an indispensable part of mobile terminals, and with the improvement of users' quality of life, users have higher and higher requirements for shooting effects. Therefore, the focus effect during shooting is becoming more and more important.

[0003] However, when using an open-loop motor (VCM) to drive the camera to focus, the stabilization time of the open-loop motor may be too long when the camera is turned on for the first time, resulting in probabilistic shaking that lasts for less than 10 seconds, thus seriously affecting the user experience. Summary of the invention

[0004] The present application proposes a focusing method, device, equipment and computer-readable storage medium, which can reduce the stabilization time of the open-loop motor and avoid focus shaking when using an open-loop motor to drive a camera to focus.

[0005] To achieve the above purpose, the technical solution of this application is implemented as follows:

[0006] In a first aspect, an embodiment of the present application provides a focusing method, which may include:

[0007] Get the current position of the camera;

[0008] Based on the current position, determining a first starting current of an open-loop motor in the camera;

[0009] Based on the first starting current, an open-loop motor is used to drive the camera to focus.

[0010] In a second aspect, an embodiment of the present application provides a focusing device, which may include an acquisition unit, a determination unit, and a driving unit; wherein:

[0011] An acquisition unit, configured to acquire a current position of the camera;

[0012] A determination unit configured to determine a first starting current of an open-loop motor in the camera based on the current position;

[0013] The driving unit is configured to drive the camera to focus using an open-loop motor based on a first starting current.

[0014] In a third aspect, an embodiment of the present application provides an electronic device, the electronic device comprising a memory and a processor, wherein:

[0015] a memory configured to store a computer program executable on the processor;

[0016] A processor is configured to execute the method as described in the first aspect when running a computer program.

[0017] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by at least one processor, it implements the method described in the first aspect.

[0018] The focusing method, device, equipment and computer-readable storage medium provided in the embodiments of the present application can obtain the current position of the camera; determine the first starting current of the open-loop motor in the camera based on the current position of the camera; and use the open-loop motor to drive the camera to focus based on the first starting current. In this way, the first starting current of the open-loop motor can be determined by the current position of the camera, so that when the open-loop motor is used to drive the camera to focus, the probability of IC algorithm compensation error can be reduced, thereby reducing the stabilization time of the open-loop motor and avoiding focus shaking. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 A flowchart of a focusing method provided in an embodiment of the present application;

[0020] Figure 2 A schematic diagram of a curve between the step length and current of an open-loop motor provided in an embodiment of the present application;

[0021] Figure 3 A schematic diagram of a framework for detecting the current corresponding to the step length of an open-loop motor provided in an embodiment of the present application;

[0022] Figure 4 A detailed flowchart of a focusing method provided in an embodiment of the present application;

[0023] Figure 5 A detailed flowchart of another focusing method provided in an embodiment of the present application;

[0024] Figure 6 A detailed flowchart of another focusing method provided in an embodiment of the present application;

[0025] Figure 7 A detailed flowchart of another focusing method provided in an embodiment of the present application;

[0026] Figure 8A schematic diagram of the composition structure of a focusing device provided in an embodiment of the present application;

[0027] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0028] Fig.10 A schematic diagram of the structure of another electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0029] In order to enable a more detailed understanding of the features and technical contents of the embodiments of the present application, the implementation of the embodiments of the present application is described in detail below in conjunction with the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present application.

[0030] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0031] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0032] It should also be pointed out that the terms "first\second\third" involved in the embodiments of the present application are only used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.

[0033] With the rapid development of smart terminals (such as mobile phones, tablet computers, etc.), mobile terminals provide more and more help to users in life, work, entertainment, etc. Among them, the shooting function has become an indispensable part of mobile terminals, and with the improvement of users' quality of life, users have higher and higher requirements for shooting effects. Therefore, the focus effect during shooting is becoming more and more important.

[0034] In the related art, when using an open-loop motor to drive the camera to focus, there may be a probability of shaking when the camera is turned on for the first time, which lasts for less than 10 seconds, thus seriously affecting the user experience.

[0035] It should be noted that the reasons for focus jitter are as follows: When the camera is turned on for the first time, the camera can be directly pushed from 0 to the telephoto position. In fact, the open-loop motor in the camera does not move from 0 to the starting current part, so the integrated circuit (IC) algorithm usually compensates for the part after the starting current. However, since the starting current is generally difficult to obtain accurately, it will cause the IC algorithm to compensate incorrectly, making the open-loop motor stabilize for too long, thus causing focus jitter.

[0036] It should also be noted that although the use of a closed-loop motor to drive the camera for focusing can solve the problem of probabilistic camera shake, it also increases costs.

[0037] Based on this, the embodiment of the present application provides a focusing method, which can obtain the current position of the camera; based on the current position of the camera, determine the first starting current of the open-loop motor in the camera; based on the first starting current, use the open-loop motor to drive the camera to focus. In this way, the first starting current of the open-loop motor can be determined by the current position of the camera, so that when the open-loop motor is used to drive the camera to focus, the probability of IC algorithm compensation error can be reduced, thereby reducing the stabilization time of the open-loop motor and avoiding focus shaking.

[0038] Figure 1 is a flow chart of a focusing method provided in an embodiment of the present application, such as Figure 1 As shown, the method may include the following steps.

[0039] S110, obtaining the current position of the camera.

[0040] It should be noted that, in the embodiments of the present application, the focusing method can be applied to a focusing device, or an electronic device integrated with the device. The electronic device can be implemented in various forms, for example, the electronic device can include such as a smart phone, a tablet computer, a laptop computer, a PDA, a portable media player (PMP), a navigation device, a wearable device, a digital camera, etc., which is not limited here.

[0041] It should also be noted that the position of the camera can indicate the placement direction of the electronic device, and the position of the camera may be different at different times.

[0042] Exemplarily, the head of the camera can be placed upward (directly above, diagonally above), the head of the camera can also be placed downward (directly below, diagonally below), and the head of the camera can also be placed vertically.

[0043] Exemplarily, the position of the camera can be represented by spatial vector coordinates (x, y, z). For example, the position of the camera at the current moment can be (x1, y1, z1); for another example, the position of the camera at the previous moment can be (x2, y2, z2).

[0044] In some embodiments, obtaining the current position of the camera may include: performing detection processing on the camera based on a gyroscope (Gyroscope, Gyro) to obtain the current position of the camera.

[0045] S120. Determine a first starting current of an open-loop motor in the camera based on the current position of the camera.

[0046] It should be noted that the starting current is the minimum current required by the open-loop motor to drive the camera to move. For example, the first starting current is the minimum current required by the open-loop motor to drive the camera at the current position to move.

[0047] It should also be noted that the starting current of the open-loop motor may be different when the camera is in different positions. Therefore, different starting currents can be given to different camera positions by detecting the state of the electronic device.

[0048] It should also be noted that in the embodiment of the present application, a corresponding relationship between the position of the camera and the starting current of the open-loop motor can be established.

[0049] Exemplarily, a spatial vector coordinate (x, y, z, I) can be established, where x, y, z can represent the position of the camera, and I can represent the starting current of the open-loop motor; the starting current can be directly called by establishing the spatial vector coordinate. For example, a spatial vector coordinate (x1, y1, z1, I1) can be established, where x1, y1, z1 can represent the current position of the camera, and I1 can represent the first starting current corresponding to the current position.

[0050] In some embodiments, based on the current position of the camera, determining the first starting current of the open-loop motor in the camera may be implemented in the following three ways.

[0051] In a possible implementation, based on the current position of the camera and in combination with prior knowledge, a first starting current corresponding to the current position can be obtained.

[0052] Exemplarily, the prior knowledge may be obtained through human experience or through experiments, which is not limited in the embodiments of the present application.

[0053] Through this method, the first starting current corresponding to the current position can be obtained more accurately based on prior knowledge, and the efficiency of obtaining the first starting current is also high. Therefore, when an open-loop motor is used to drive the camera to focus based on the first starting current, the probability of IC algorithm compensation error can be reduced, thereby reducing the stabilization time of the open-loop motor and avoiding focus shake.

[0054] Another possible implementation method is to determine the first starting current of the open-loop motor in the camera based on the current position of the camera, which may include: obtaining a database, the database including the correspondence between the preset position and the first preset current; and determining the first starting current based on the current position of the camera and the database.

[0055] It should be noted that the database may be pre-configured.

[0056] It should also be noted that the preset position may be one or more positions of the camera, and the first preset current may be the starting current of the open-loop motor corresponding to the one or more positions. The preset position may include at least one of the following:

[0057] The camera's existing position or positions before the current moment;

[0058] The camera's current position;

[0059] One or more possible positions of the camera after the current time.

[0060] Exemplarily, a spatial vector coordinate (x, y, z, I) may be established in a database, where x, y, z may represent a preset position, and I may represent a first preset current. For example, the database may include spatial vector coordinates (x1, y1, z1, I1), (x2, y2, z2, I2), (x3, y3, z3, I3), (x4, y4, z4, I4), and the like.

[0061] In some embodiments, determining the first starting current based on the current position of the camera and a database may include: querying the database for a first preset current corresponding to the current position of the camera; and determining the first preset current corresponding to the current position of the camera as the first starting current.

[0062] Exemplarily, assuming that the database may include spatial vector coordinates (x1, y1, z1, I1), (x2, y2, z2, I2), (x3, y3, z3, I3), and (x4, y4, z4, I4), and the current position of the camera is x1, y1, and z1. By querying the database, the first preset current corresponding to x1, y1, and z1 is I1, it means that the first starting current corresponding to the current position of the camera x1, y1, and z1 is I1.

[0063] Through this method, the first starting current can be determined based on the current position of the camera and the database, and the efficiency of obtaining the first starting current is also high. Therefore, when an open-loop motor is used to drive the camera to focus based on the first starting current, the probability of IC algorithm compensation error can be reduced, thereby reducing the stabilization time of the open-loop motor and avoiding focus shake.

[0064] Another possible implementation method is to determine the first starting current of the open-loop motor in the camera based on the current position of the camera, which may include: obtaining the burn-in current of the open-loop motor; determining whether the burn-in current of the open-loop motor is an inflection point current; and determining the first starting current corresponding to the current position of the camera based on whether the burn-in current of the open-loop motor is an inflection point current.

[0065] Exemplarily, the programming current may be programmed using a One Time Programmable (OTP) module.

[0066] It should be noted that at the inflection point current, the camera lens begins to move, so the inflection point current can be used as the first starting current corresponding to the current position of the camera. For example, assuming that at the burn-in current, the camera lens begins to move, then the burn-in current can be determined to be the inflection point current, and at this time, the burn-in current is also the first starting current corresponding to the current position of the camera. For another example, assuming that at the inflection point current, the camera lens does not move, then it can be determined that the burn-in current is not the inflection point current.

[0067] In some embodiments, determining a first starting current corresponding to the current position of the camera based on whether the burn-in current of the open-loop motor is an inflection point current may include: when the burn-in current is an inflection point current, determining the burn-in current as the first starting current corresponding to the current position of the camera; when the burn-in current is not an inflection point current, superimposing the burn-in current at every preset step length to obtain a second preset current, so that the second preset current is an inflection point current, and determining the second preset current as the first starting current corresponding to the current position of the camera.

[0068] It should be noted that, when the programming current is not the inflection point current, the current corresponding to different codes can be detected through the relationship between the step length (Code) of the open-loop motor and the current.

[0069] Figure 2 A schematic diagram of a curve between the step length (Code) and the current of an open-loop motor provided in an embodiment of the present application. Figure 2As shown, there is a one-to-one correspondence between Code and current. The area where the curve between Code and current is located can be divided into a linear area and a nonlinear area. In the nonlinear area, the change between Code and current is nonlinear; while in the linear area, the change between Code and current is linear. The intersection of the linear area and the nonlinear area can be an inflection point, and the ordinate of the inflection point is the inflection point current.

[0070] Figure 3 A schematic diagram of a framework for detecting the current corresponding to the step length of an open-loop motor provided in an embodiment of the present application. Figure 3 As shown, the framework may include an auto focus (AF) IC output, an analog-to-digital converter (ADC) channel, a precision resistor R, and a module, which may include a lens and an open-loop motor in a camera. Through the precision resistor R, the voltage at both ends can be measured, so that the path current can be calculated. By fixing the code, the current corresponding to different codes can be obtained.

[0071] Exemplarily, when the burning current is not an inflection point current, the current corresponding to the current Code can be calculated for each interval of the preset Code, so that the burning current can be superimposed until the second preset current obtained after superposition is at the junction of the linear area and the nonlinear area. At this time, the second preset current is the inflection point current, and the second preset current can be determined as the first starting current corresponding to the position of the camera at the current moment.

[0072] Through this method, the first starting current corresponding to the current position of the camera can be determined based on whether the burn-in current of the open-loop motor is the inflection point current. Therefore, when the open-loop motor is used to drive the camera to focus based on the first starting current, the probability of IC algorithm compensation error can be reduced, thereby reducing the stabilization time of the open-loop motor and avoiding focus shaking.

[0073] It should be noted that the first starting current of the open-loop motor in the camera can be obtained by using the above three possible implementation methods. It can be understood that the above three possible implementation methods can be used alone or in combination.

[0074] Exemplarily, when the first starting current cannot be obtained based on the current position of the camera and prior knowledge, the first starting current can be obtained based on the current position of the camera and a database; or, the first starting current corresponding to the current position of the camera can be obtained based on whether the burn-in current of the open-loop motor is an inflection point current.

[0075] For example, when the current position of the camera cannot be queried from the database, and thus the starting current corresponding to the current position of the camera cannot be obtained, the first starting current corresponding to the current position of the camera can be obtained based on whether the burn-in current of the open-loop motor is an inflection point current.

[0076] It should also be noted that when the starting current corresponding to the current position of the camera cannot be obtained from the database, when the first starting current corresponding to the current position of the camera is obtained by other means, the current position of the camera and the first starting current can be recorded in the data, thereby supplementing the database.

[0077] S130: Based on the first starting current, use an open-loop motor to drive the camera to focus.

[0078] In some embodiments, the method may also include: obtaining a second starting current of the open-loop motor, the second starting current corresponding to the position of the camera at a previous moment; calculating the difference between the first starting current and the second starting current; determining a target proportional-integral-differential (PID) parameter based on the difference, the target PID parameter being used to optimize the focus of the camera.

[0079] Through this method, different PID parameter compensations can be performed based on different starting current gradients (ie, differences), thereby optimizing the camera startup effect.

[0080] In some embodiments, determining the target PID parameter based on the difference may include: obtaining a first PID parameter, the first PID parameter corresponding to the position of the camera at a previous moment; when the difference is less than or equal to a third preset current, determining the first PID parameter as the target PID parameter.

[0081] It should be noted that the third preset current may be defined by a protocol, may be set manually, or may be set by other means, and this is not limited in the embodiments of the present application.

[0082] Exemplarily, the third preset current may be 10 mA.

[0083] In other embodiments, determining the target PID parameter based on the difference may include: obtaining a second PID parameter, the second PID parameter corresponding to the position of the camera at a current moment; and determining the second PID parameter as the target PID parameter when the difference is greater than a third preset current.

[0084] It should be noted that the second PID parameter may be configured in advance, and the second PID parameter may be obtained through update download.

[0085] The embodiment of the present application provides a focusing method, which can obtain the current position of the camera; determine the first starting current of the open-loop motor in the camera based on the current position of the camera; and use the open-loop motor to drive the camera to focus based on the first starting current. In this way, the first starting current of the open-loop motor can be determined by the current position of the camera, so that when the open-loop motor is used to drive the camera to focus, the probability of IC algorithm compensation error can be reduced, thereby reducing the stabilization time of the open-loop motor and avoiding focus shaking.

[0086] The focusing method provided in the above embodiment is described in detail below in combination with specific application scenarios.

[0087] The embodiment of the present application proposes a technical solution for focusing optimization to solve the problem that the starting current is difficult to obtain accurately, which causes IC algorithm compensation errors and leads to focusing jitter. Figure 4 The detailed flow diagram of the focusing method shown in FIG. 1 illustrates the technical solution. The detailed flow of the focusing method may mainly include starting current identification and PID performance optimization, such as Figure 4 As shown, the detailed process of the focusing method may include the following steps.

[0088] S410, starting current of the main camera of the mobile phone to be identified.

[0089] It should be noted that the motor does not move in the portion from 0 to the starting current, and the starting current needs to be compensated when the open-loop motor is started for the first time, that is, the starting current needs to be re-determined when the open-loop motor is started for the first time.

[0090] S420, read the programming current.

[0091] Exemplarily, the burning current may be for burning an OTP module.

[0092] S430, linearity detection.

[0093] S440, start current calibration.

[0094] S450 , writing a new starting current (ie, the first starting current).

[0095] It should be noted that whether the camera lens moves can be detected by linearity. If there is movement, the starting current needs to be recalibrated and then updated (ie, a new starting current is written).

[0096] For example, Figure 2 As shown, for the area where the curve between Code and current is located, the camera lens starts to move at the intersection of the nonlinear area and the linear area (ie, the inflection point). At this time, the starting current needs to be recalibrated and a new starting current needs to be written.

[0097] It should also be noted that the starting current in different directions is also different, so it is necessary to detect the status of the mobile phone and give different starting currents in different directions.

[0098] S460, distributed power on.

[0099] It should be noted that after obtaining the starting current of the open-loop motor, the IC algorithm can compensate for the part after the starting current, thereby reducing the probability of IC algorithm compensation error, thereby reducing the stabilization time of the open-loop motor and avoiding focus shake.

[0100] It should also be noted that a distributed power-on solution can be used to allow the IC algorithm to compensate for the portion after the starting current, thereby avoiding the impact of the starting current.

[0101] S470, optimize the PID compensation algorithm.

[0102] It should be noted that the PID parameters can be optimized based on the difference between the written new starting current and the starting current of the open-loop motor at the previous moment (i.e., the second starting current). When the difference is less than or equal to the third preset current, the optimized PID parameters are the PID parameters of the open-loop motor at the previous moment (i.e., the first PID parameters); when the difference is greater than the third preset current, the optimized PID parameters can be obtained by updating and downloading (i.e., the second PID parameters).

[0103] S480, output effect diagram.

[0104] Through this method, different PID parameter compensations can be performed based on different starting current gradients (ie, differences), thereby optimizing the camera startup effect.

[0105] In the embodiment of the present application, the compensation of the starting current can be understood as the writing of a new starting current. The embodiment of the present application can compensate the starting current every time the camera is turned on, thereby realizing real-time compensation of the starting current. The starting current can be detected by the relationship between the Code and the current. Figure 5 A detailed flow chart of another focusing method provided in an embodiment of the present application is as follows: Figure 5 As shown, the detailed process may include the following steps.

[0106] S510, obtaining the programming current.

[0107] S520, linearity detection to see whether the programming current is an inflection point.

[0108] It should be noted that it can be based on Figure 2The curve between the code and the current shown in the figure is used for linearity detection. In the nonlinear region, the change between the code and the current is nonlinear; while in the linear region, the change between the code and the current is linear. When the burning current is located at the intersection of the linear region and the nonlinear region, it can be determined that the burning current is an inflection point. At this time, the burning current can be used as the starting current, that is, S530 is executed; when the burning current is not located at the intersection of the linear region and the nonlinear region, it can be determined that the burning current is not an inflection point. At this time, the burning current can be adjusted by gradient current, that is, S540 is executed.

[0109] S530, using the programming current as the starting current.

[0110] S540, performing gradient current adjustment on the programming current.

[0111] It should be noted that when the programming current is gradient regulated, a preset step length may be set at each interval, and the programming current may be superimposed to obtain an regulated current.

[0112] S550, linearity detection to determine whether the adjusted current is an inflection point.

[0113] It should be noted that, when the adjusted current is located at the intersection of the linear region and the nonlinear region, it can be determined that the adjusted current (i.e., the second preset current) is an inflection point. At this time, the adjusted current can be used as the starting current, that is, S560 is executed; when the adjusted current is not located at the intersection of the linear region and the nonlinear region, it can be determined that the adjusted current is not an inflection point. At this time, gradient current adjustment can be performed again, that is, S540 is executed.

[0114] S560: Use the adjusted current as the starting current.

[0115] Through this method, the actual starting current can be calculated in real time and effectively, so that when using an open-loop motor to drive the camera for focusing, the probability of IC algorithm compensation error can be reduced, thereby reducing the stabilization time of the open-loop motor and avoiding focus shake.

[0116] In the embodiment of the present application, the starting current is different for different mobile phone placement directions. A spatial vector coordinate (x, y, z, I) can be established, where x, y, z represent the placement direction of the mobile phone, and I represents the starting current. The starting current can be directly called by means of spatial vector coordinates.

[0117] Figure 6 A detailed flow chart of another focusing method provided in an embodiment of the present application is as follows: Figure 6 As shown, the detailed process may include the following steps.

[0118] S610, starting current of the main camera of the mobile phone to be identified.

[0119] S620, confirm the spatial vector coordinates.

[0120] It should be noted that the space vector coordinates can represent the position of the camera at the current moment.

[0121] S630: Database comparison.

[0122] It should be noted that the current corresponding to the spatial vector coordinates (i.e., the first preset current) can be searched in the database. If the current corresponding to the spatial vector coordinates exists in the database, the database current can be called, and the called database current is determined as the starting current, that is, S640 is executed; if the current corresponding to the spatial vector coordinates does not exist in the database, a new spatial vector name can be created, and the starting current can be used. Figure 5 The method shown performs linearity detection on the programming current to determine the starting current, and adds the starting current corresponding to the space vector coordinate into the database, that is, executing S650 to S680.

[0123] S640, call the database current.

[0124] Exemplarily, the retrieved database current may be determined as the starting current.

[0125] S650. Create a new space vector name.

[0126] Exemplarily, the space vector name may be an identifier of the space vector coordinates.

[0127] S660, linearity detection.

[0128] It should be noted that you can use Figure 5 The method shown is used to detect the linearity of the programming current.

[0129] S670: Determine the starting current.

[0130] Exemplarily, based on the linear detection of the programming current, the starting current corresponding to the space vector coordinates can be determined.

[0131] S680, supplement database.

[0132] Exemplarily, the starting current corresponding to the space vector coordinates may be added to the database.

[0133] Through this method, the actual starting current can be calculated in real time and effectively, so that when using an open-loop motor to drive the camera for focusing, the probability of IC algorithm compensation error can be reduced, thereby reducing the stabilization time of the open-loop motor and avoiding focus shake.

[0134] Figure 7A detailed flow chart of another focusing method provided in an embodiment of the present application is as follows: Figure 7 As shown, the detailed process may include the following steps.

[0135] S710: Determine the current position of the camera based on gyroscope detection.

[0136] S720: Call the corresponding starting current.

[0137] It should be noted that the current position of the camera can be determined based on gyroscope detection, so that Figure 5 or Figure 6 The method shown determines the starting current corresponding to the position of the camera at the current moment, so that the starting current can be called.

[0138] S730: Compare the difference between the current starting current and the previous starting current to see whether it is greater than a third preset current.

[0139] It should be noted that the current starting current is the starting current corresponding to the position of the camera at the current moment, and the previous starting current is the starting current corresponding to the position of the camera at the previous moment.

[0140] It should also be noted that when the difference between the current start-up current and the previous start-up current is greater than the third preset current, new PID parameters can be updated and downloaded, and the new PID parameters can correspond to the current position of the camera, that is, S740 is executed; when the difference between the current start-up current and the previous start-up current is less than or equal to the third preset current, the previous PID parameters can be used, and the previous PID parameters can correspond to the position of the camera at the previous moment, that is, S750 is executed.

[0141] For example, assuming that the third preset current is 10 mA, the difference between the two starting currents can be compared. If the difference is within 10 mA, the previous PID parameters can be used; if the difference is greater than 10 mA, new PID parameters can be updated and downloaded.

[0142] S740, update and download new PID parameters.

[0143] It should be noted that the new PID parameter may correspond to the current position of the camera.

[0144] S750: Continue to use the previous PID parameters.

[0145] It should be noted that the previous PID parameter may correspond to the position of the camera at the previous moment.

[0146] Through this method, different PID parameter compensations can be performed based on different starting current gradients (ie, differences), thereby optimizing the camera startup effect.

[0147] The embodiment of the present application proposes a spatial vector compensation method. The starting current of the open-loop motor can be determined by the current position of the camera, so that the probabilistic shaking problem of the camera can be solved when the open-loop motor is used to drive the camera for focusing, which not only improves the overall performance of the mobile phone, but also greatly enhances the competitiveness of the product.

[0148] The embodiment of the present application provides a novel focus software optimization solution, which can import a space vector model according to the placement of the mobile phone, and perform dynamic compensation of the starting current based on the space vector model, thereby optimizing the startup of the open-loop motor, improving the stability of starting the camera, and improving the efficiency of shooting.

[0149] The technical solution provided by the embodiment of the present application is not only applicable to the mobile phone industry, but also to all products using camera open-loop motors. In addition, the technical solution provided by the embodiment of the present application can be applied not only to open-loop motor optimization, but also to effect debugging and drive performance optimization.

[0150] The preferred embodiments of the present application are described in detail above in conjunction with the accompanying drawings. However, the present application is not limited to the specific details in the above embodiments. Within the technical concept of the present application, the technical solution of the present application can be subjected to a variety of simple modifications, and these simple modifications all belong to the protection scope of the present application. For example, the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, the present application will not further explain various possible combinations. For another example, the various different embodiments of the present application can also be arbitrarily combined, as long as they do not violate the idea of ​​the present application, they should also be regarded as the contents disclosed in the present application. For another example, under the premise of no conflict, the various embodiments and / or the technical features in the various embodiments described in the present application can be arbitrarily combined with the prior art, and the technical solution obtained after the combination should also fall within the protection scope of the present application.

[0151] It should be understood that in the various method embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0152] Based on the same inventive concept as the above embodiments, Figure 8 FIG. 8 is a schematic diagram showing the composition structure of a focusing device 800 provided in an embodiment of the present application. Figure 8 As shown, the focusing device 800 may include an acquisition unit 810, a determination unit 820 and a driving unit 830, wherein:

[0153] An acquisition unit 810 is configured to acquire the current position of the camera;

[0154] A determination unit 820, configured to determine a first starting current of an open-loop motor in the camera based on the position at a current moment;

[0155] The driving unit 830 is configured to drive the camera to focus using an open-loop motor based on the first starting current.

[0156] In some embodiments, the acquisition unit 810 is further configured to acquire a database, which includes a correspondence between a preset position and a first preset current; the determination unit 820 is further configured to determine the first starting current based on the current position and the database.

[0157] In some embodiments, the focusing device 800 may further include a query unit 840, wherein:

[0158] A query unit 840, configured to query a first preset current corresponding to the position at a current moment from a database;

[0159] The determining unit 820 is further configured to determine a first preset current corresponding to the position at the current moment as the first starting current.

[0160] In some embodiments, the focusing device 800 may further include a determination unit 850, wherein:

[0161] The acquisition unit 810 is further configured to acquire the burning current of the open-loop motor;

[0162] A judging unit 850 is configured to judge whether the burning current is an inflection point current;

[0163] The determination unit 820 is further configured to determine a first starting current corresponding to the position at a current moment based on whether the programming current is an inflection point current.

[0164] In some embodiments, the determination unit 820 is further configured to, when the burning current is an inflection point current, determine the burning current as a first starting current corresponding to the position at the current moment; when the burning current is not an inflection point current, superimpose the burning current at each preset step length to obtain a second preset current, so that the second preset current is an inflection point current, and determine the second preset current as the first starting current corresponding to the position at the current moment.

[0165] In some embodiments, the focusing device 800 may further include a calculation unit 860, wherein:

[0166] The acquisition unit 810 is further configured to acquire a second starting current of the open-loop motor, where the second starting current corresponds to a position of the camera at a previous moment;

[0167] A calculation unit 860, configured to calculate a difference between the first starting current and the second starting current;

[0168] The determination unit 820 is further configured to determine a target proportional integral differential PID parameter based on the difference, where the target PID parameter is used to optimize the focus of the camera.

[0169] In some embodiments, the acquisition unit 810 is further configured to acquire a first PID parameter, which corresponds to the position of the camera at a previous moment; the determination unit 820 is further configured to determine the first PID parameter as the target PID parameter when the difference is less than or equal to a third preset current.

[0170] In some embodiments, the acquisition unit 810 is further configured to acquire a second PID parameter, which corresponds to the position of the camera at a current moment; the determination unit 820 is further configured to determine the second PID parameter as the target PID parameter when the difference is greater than a third preset current.

[0171] In some embodiments, the acquisition unit 810 is further configured to perform detection processing on the camera based on the gyroscope to acquire the current position.

[0172] It can be understood that in this embodiment, a "unit" can be a part of a circuit, a part of a processor, a part of a program or software, etc., and of course it can also be a module, or it can be non-modular. Moreover, the components in this embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional module.

[0173] If the integrated unit is implemented in the form of a software function module and is not 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 this embodiment is essentially or the part that contributes to the prior art or the whole or 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, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.

[0174] Therefore, this embodiment provides a computer storage medium, which stores a computer program. When the computer program is executed by at least one processor, the steps of the method described in any one of the above embodiments are implemented.

[0175] Based on the above-mentioned components of the focusing device 800 and the computer storage medium, see Fig. 9 , which shows a schematic diagram of the composition structure of an electronic device provided by an embodiment of the present application. Fig. 9 As shown, the electronic device 900 may include: a communication interface 910, a memory 920 and a processor 930; each component is coupled together via a bus system 940. It is understood that the bus system 940 is configured to achieve connection and communication between these components. In addition to the data bus, the bus system 940 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, Fig. 9 Various buses are labeled as bus system 940. Among them, the communication interface 910 is configured to receive and send signals during the process of sending and receiving information between other external network elements;

[0176] A memory 920 configured to store a computer program that can be executed on the processor 930;

[0177] The processor 930 is configured to execute, when running the computer program:

[0178] Get the current position of the camera;

[0179] Based on the current position, determining a first starting current of an open-loop motor in the camera;

[0180] Based on the first starting current, an open-loop motor is used to drive the camera to focus.

[0181] It can be understood that the memory 920 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 but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct memory bus random access memory (DRRAM). The memory 920 of the system and method described in the embodiments of the present application is intended to include but is not limited to these and any other suitable types of memory.

[0182] The processor 930 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 930. The above processor 930 may be a general processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor to be executed, or the hardware and software modules in the decoding processor are combined and executed. The software module can be located in a mature storage medium in the field 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 920, and the processor 930 reads the information in the memory 920 and completes the steps of the above method in combination with its hardware.

[0183] It is understood that the embodiments described in the present application can be implemented by hardware, software, firmware, middleware, microcode or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in the present application or a combination thereof.

[0184] For software implementation, the technology described in this application can be implemented by a module (e.g., a procedure, a function, etc.) that performs the functions described in this application. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.

[0185] Optionally, as another embodiment, the processor 930 is further configured to execute the steps of the method described in any one of the aforementioned embodiments when running the computer program.

[0186] Based on the above-mentioned components of the focusing device 800 and the computer storage medium, see Fig.10 , which shows a schematic diagram of the composition structure of another electronic device provided by an embodiment of the present application. Fig.10 As shown, the electronic device 900 may include the focusing device 800 described in any one of the aforementioned embodiments.

[0187] In the embodiment of the present application, for the electronic device 900, the current position of the camera can be obtained; based on the current position of the camera, the first starting current of the open-loop motor in the camera is determined; based on the first starting current, the camera is driven to focus using the open-loop motor. In this way, the first starting current of the open-loop motor can be determined by the current position of the camera, so that when the open-loop motor is used to drive the camera to focus, the probability of IC algorithm compensation error can be reduced, thereby reducing the stabilization time of the open-loop motor and avoiding focus shaking.

[0188] It should be noted that, in this application, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0189] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0190] The methods disclosed in several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.

[0191] The features disclosed in several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.

[0192] The features disclosed in several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.

[0193] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A focusing method, characterized in that: The method comprises: Get the current position of the camera; Based on the current position, determining a first starting current of an open-loop motor in the camera; Based on the first starting current, the open-loop motor is used to drive the camera to focus.

2. The method according to claim 1, characterized in that The determining, based on the current position, a first starting current of an open-loop motor in the camera includes: Acquire a database, wherein the database includes a correspondence between a preset position and a first preset current; The first starting current is determined based on the current position and the database.

3. The method according to claim 2, characterized in that The determining the first starting current based on the current position and the database includes: Querying the database for a first preset current corresponding to the position at the current moment; A first preset current corresponding to the position at the current moment is determined as the first starting current.

4. The method according to claim 1, characterized in that: The determining, based on the current position, a first starting current of an open-loop motor in the camera includes: Obtaining the burning current of the open-loop motor; Determining whether the burning current is an inflection point current; Based on whether the programming current is an inflection point current, the first starting current corresponding to the position at the current moment is determined.

5. The method according to claim 4, characterized in that The determining the first starting current corresponding to the position at the current moment based on whether the burning current is an inflection point current includes: In the case where the burning current is an inflection point current, determining the burning current as the first starting current corresponding to the position at the current moment; When the programming current is not an inflection point current, the programming current is superimposed at every preset step length to obtain a second preset current, so that the second preset current is an inflection point current, and the second preset current is determined as the first starting current corresponding to the position at the current moment.

6. The method according to any one of claims 1 to 5, characterized in that The method further comprises: Acquire a second starting current of the open-loop motor, where the second starting current corresponds to a position of the camera at a previous moment; calculating a difference between the first starting current and the second starting current; A target proportional integral derivative (PID) parameter is determined based on the difference, and the target PID parameter is used to optimize the focus of the camera.

7. The method according to claim 6, characterized in that The determining of the target PID parameter based on the difference comprises: Obtaining a first PID parameter, where the first PID parameter corresponds to a position of the camera at a previous moment; When the difference is less than or equal to a third preset current, the first PID parameter is determined as the target PID parameter.

8. The method according to claim 6, characterized in that The determining of the target PID parameter based on the difference comprises: Obtain a second PID parameter, where the second PID parameter corresponds to the current position of the camera; When the difference is greater than a third preset current, the second PID parameter is determined as the target PID parameter.

9. The method according to any one of claims 1 to 5, characterized in that The obtaining of the current position of the camera includes: The camera is detected and processed based on a gyroscope to obtain the position at the current moment.

10. A focusing device, characterized in that: The focusing device comprises an acquisition unit, a determination unit and a driving unit; wherein: The acquisition unit is configured to acquire the current position of the camera; The determining unit is configured to determine a first starting current of an open-loop motor in the camera based on the position at the current moment; The driving unit is configured to drive the camera to focus using the open-loop motor based on the first starting current.

11. An electronic device, characterized in that: The electronic device comprises a memory and a processor, wherein: The memory is configured to store a computer program that can be executed on the processor; The processor is configured to execute the method according to any one of claims 1 to 9 when running the computer program.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by at least one processor, the method according to any one of claims 1 to 9 is implemented.