Camera motor reset method, system, device and storage medium
The hardware abstraction layer module obtains the camera motor home information and performs the motor home and resource release in parallel, solving the problem of the long return time of the motor when the traditional camera exits, and improving the camera exit performance and resource utilization efficiency.
Patent Information
- Application Number
- CN202210259083.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-16
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2042-03-16
AI Technical Summary
The motor return time when a traditional camera exits is long, which affects camera performance, and it is difficult for the prior art to effectively coordinate the timing relationship between motor pushing and resource release of algorithm modules and sensor modules.
The hardware abstraction layer module obtains the camera motor home information, and when exiting the camera application, the motor home is performed through the first thread. At the same time, the second thread releases data resources to realize thread parallel operation, reducing the time spent on motor home exit to the camera The impact of total time consuming.
It effectively reduces the time-consuming return of the camera motor, improves the camera exit performance, and improves the reuse rate of system resources through resource release.
Smart Images

Figure CN114661464B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of camera motor technology, and in particular to a camera motor homing method, system, device and storage medium. Background Art
[0002] From the perspective of camera performance, the time taken to exit the camera is an important indicator to measure camera performance. On mobile devices, there are multiple implementations for motor push, but when exiting the camera to release resources, it is necessary to consider the timing relationship between motor push, camera algorithm module resource release, and camera sensor module resource release. It is necessary to perform deinitialization operations on each module of the camera in turn to release the resources they occupy, and control the time taken to exit the camera while ensuring that the motor returns to its normal position.
[0003] In order to avoid the collision sound between modules after the sensor is powered off, most cameras in mobile devices on the market will reset the motor before the sensor is powered off. The motor reset operation when exiting the camera on traditional mobile devices is mostly completed by the algorithm module before the resources are released, and the long motor reset time seriously affects the performance of camera exit.
[0004] Therefore, a new camera motor homing solution is urgently needed to improve the above problems. Summary of the invention
[0005] The object of the present invention is to provide a camera motor reset method, system, device and storage medium, which are used to reduce the impact of the camera motor reset time on the total camera exit time.
[0006] In a first aspect, an embodiment of the present invention provides a camera motor home method, which is applied to a terminal device, wherein a software system of the terminal device includes a hardware abstraction layer module, a data processing algorithm module and a camera driver module, and the method includes: when exiting a camera application, the hardware abstraction layer module obtains home information of the camera motor of the terminal device from the data processing algorithm module; the hardware abstraction layer module transmits the home information of the camera motor to the camera driver module; the camera driver module performs home information of the camera motor through a first thread when exiting the camera application according to the home information of the camera motor; the data processing algorithm module releases data resources occupied by the camera during operation through a second thread; and the first thread and the second thread are parallel in timing.
[0007] The beneficial effect of the camera motor homing method provided by the embodiment of the present invention is that: when exiting the camera application, the hardware abstraction layer module obtains the homing information of the camera motor from the data processing algorithm module, and at this time, the data processing algorithm module can release the data resources occupied by the camera during operation through the second thread. At the same time, the hardware abstraction layer module transmits the homing information of the camera motor to the camera driver module, and the camera driver module performs the motor homing through the first thread according to the homing information of the camera motor, so as to complete the homing operation of the camera motor. In this way, the first thread and the second thread can be parallel in timing, and can release data resources while the camera motor is homing, thereby reducing the impact of the camera motor homing time on the total camera exit time, and improving the performance of the camera when exiting.
[0008] In a possible implementation, the camera motor is reset when the camera application is exited, and further includes: the camera driver module updates the state of the soft landing flag to a completed state. The beneficial effect is that by updating the state of the soft landing flag to a completed state, it is easy to confirm that the motor reset is completed.
[0009] In a possible implementation, after the hardware abstraction layer module transmits the homing information of the camera motor to the camera driver module, the hardware abstraction layer further includes: releasing the system integrated module resources, image sensor module resources, and image read-write module resources occupied by the camera during operation. The beneficial effect is that by releasing the system integrated module resources, image sensor module resources, and image read-write module resources occupied by the camera during operation, it is convenient to reuse resources, save system resources, and thus improve the performance of the camera.
[0010] In a possible implementation, the homing information includes the current position information of the motor, the target position information, the step length of each movement, and the interval time of each movement. The beneficial effect is that the distance that the camera motor needs to move is known through the current position information of the motor and the target position information, and the number of times the camera motor needs to move is obtained through the step length of each movement and the interval time of each movement, so as to facilitate the control of the homing of the camera motor.
[0011] In a second aspect, an embodiment of the present invention provides a camera motor homing system, which is applied to a terminal device, and includes a hardware abstraction layer module, a data processing algorithm module and a camera driver module, including: when exiting the camera application, the hardware abstraction layer module is used to obtain the homing information of the camera motor of the terminal device from the data processing algorithm module; the hardware abstraction layer module is also used to transmit the homing information of the camera motor to the camera driver module; the camera driver module is used to perform the homing of the camera motor through a first thread when exiting the camera application according to the homing information of the camera motor; the data processing algorithm module is used to release the data resources occupied by the camera during operation through a second thread; the first thread and the second thread are parallel in timing.
[0012] In a possible implementation, after the camera driving module resets the camera motor, it is further configured to: update the status of the soft landing flag to a completion status.
[0013] In a possible implementation, after the hardware abstraction layer transmits the homing information of the camera motor to the camera driver module, it is also used to: release the system integration module resources, image sensor module resources and image reading and writing module resources occupied by the camera during operation.
[0014] In a possible implementation, the homing information includes current position information of the motor, target position information, a step length of each movement, and an interval time of each movement.
[0015] In a third aspect, an embodiment of the present invention provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any of the methods described in any one of the first aspects above.
[0016] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium for storing a computer program, wherein the computer program enables a computer to execute any one of the methods described in the first aspect.
[0017] For the beneficial effects of the second to fourth aspects, reference may be made to the description of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 A camera motor homing system provided by an embodiment of the present invention;
[0019] Figure 2 A camera motor homing method provided by an embodiment of the present invention;
[0020] Figure 3 A schematic diagram of a camera motor reset process provided by an embodiment of the present invention.
[0021] Numbers in the figure:
[0022] 101. Hardware abstraction layer module;
[0023] 102. Data processing algorithm module; 1021. Control layer; 1022. Adaptation layer; 1023. Algorithm library;
[0024] 103. Camera driver module;
[0025] 104. System integration module;
[0026] 105. Image sensor module;
[0027] 106. Image reading and writing module. DETAILED DESCRIPTION
[0028] In order to make the purpose, technical solutions and advantages of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. Unless otherwise defined, the technical terms or scientific terms used herein should be understood by people with general skills in the field to which the present invention belongs. "Including" and similar words used in this article mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects.
[0029] In view of the problems existing in the prior art, an embodiment of the present invention provides a camera motor homing method, which can be applied to a terminal device having a camera, such as Figure 1 As shown, the software system architecture of the terminal device includes a hardware abstraction layer module 101, a data processing algorithm module 102 and a camera driver module 103. Among them:
[0030] The hardware abstraction layer module 101 is used to obtain the homing information of the camera motor from the data processing algorithm module when exiting the camera application, and is also used to transmit the homing information of the camera motor to the camera driver module. For example, the hardware abstraction layer module 101 is the camera hardware abstraction layer (camera HAL) in the Android architecture.
[0031] The camera driver module 103 is used to perform motor reset when exiting the camera application according to the reset information of the camera motor through the first thread. In some embodiments, the camera driver module 103 is a device driver layer of the camera in the Android architecture.
[0032] The data processing algorithm module 102 is used to release the data resources occupied by the camera during operation through the second thread; the first thread and the second thread are parallel in timing. In some embodiments, the data processing algorithm module 102 is an image signal processing algorithm module (Image Signal Processing, ISP).
[0033] Combination Figure 1 The software system architecture of the terminal device shown in FIG. 1 is a method for homing a camera motor provided by an embodiment of the present invention. Figure 2 As shown, the method includes the following steps.
[0034] S201, when exiting the camera application, the hardware abstraction layer module 101 obtains the homing information of the camera motor of the terminal device from the data processing algorithm module 102;
[0035] S202, the hardware abstraction layer module 101 transmits the homing information of the camera motor to the camera driving module 103;
[0036] S203, the camera driving module 103 performs the camera motor reset when exiting the camera application according to the reset information of the camera motor through the first thread;
[0037] S204: The data processing algorithm module 102 releases the data resources occupied by the camera during operation through the second thread; the first thread and the second thread are parallel in timing.
[0038] In some embodiments, the terminal device is a mobile terminal device, and when exiting a camera application of the terminal device, the camera motor needs to be reset.
[0039] In some embodiments, the data processing algorithm module 102 includes a control layer 1021 , an adaptation layer 1022 and an algorithm library 1023 .
[0040] The camera motor homing method of the present application obtains the homing information of the camera motor from the data processing algorithm module 102 through the hardware abstraction layer module 101. After the hardware abstraction layer module 101 obtains the homing information of the camera motor, the data processing algorithm module 102 can release the data resources occupied by the camera during operation through the second thread, that is, release the resources occupied by the data processing algorithm module 102. At the same time, after the hardware abstraction layer module 101 obtains the homing information of the camera motor, the hardware abstraction layer module 101 transmits the homing information of the camera motor to the camera driver module 103, and then the camera driver module 103 performs the homing operation of the camera motor through the first thread according to the homing information of the camera motor.
[0041] In some embodiments, the hardware abstraction layer module 101 transmits the homing information of the camera motor to the camera driver module 103, specifically including: the hardware abstraction layer module 101 transmits the homing information of the camera motor to the image sensor module 105, and returns after completion. The image sensor module 105 transmits the received homing information of the camera motor to the camera driver module 103.
[0042] In some embodiments, the first thread and the second thread are executed in parallel in terms of timing, that is, the first thread and the second thread are executed separately.
[0043] It is worth noting that there is no strict sequence between S202 and S204 in the above steps.
[0044] In some embodiments of the present invention, after the hardware abstraction layer module 101 transmits the homing information of the camera motor to the camera driver module 103, it also includes: the hardware abstraction layer releases the resources of the system integration module 104, the image sensor module 105 and the image reading and writing module 106 occupied by the camera during operation.
[0045] In some specific embodiments of the present invention, after the hardware abstraction layer module 101 transmits the homing information of the camera motor to the camera driver module 103, the hardware abstraction layer module 101 releases the resources of the system integration module 104, the image sensor module 105 and the image reading and writing module 106 occupied by the camera during operation, and the order of releasing the resources of the system integration module 104, the image sensor module 105 and the image reading and writing module 106 is not particular.
[0046] In some embodiments, after the hardware abstraction layer module 101 transmits the homing information of the camera motor to the camera driver module 103 , the hardware abstraction layer module 101 releases the resources of the image sensor module 105 , and returns after completing the resource release of the image sensor module 105 .
[0047] In some other embodiments, after the hardware abstraction layer module 101 transmits the homing information of the camera motor to the camera driver module 103, the hardware abstraction layer module 101 releases the resources of the system integration module 104 and returns after completing the release of the resources of the system integration module 104.
[0048] In some other embodiments, after the hardware abstraction layer module 101 transmits the homing information of the camera motor to the camera driver module 103, the hardware abstraction layer module 101 releases the resources of the image reading and writing module 106, and returns after completing the release of the resources of the image reading and writing module 106.
[0049] In some embodiments of the present invention, the camera motor is reset when exiting the camera application, and further includes: the camera driver module 103 updates the status of the soft landing flag to a completion status.
[0050] In some specific embodiments of the present invention, after the camera motor is homed, the camera driver module 103 updates the state of the soft landing flag to a completion state, so as to know that the homed action of the camera motor is completed.
[0051] In some other embodiments, when the hardware abstraction layer module 101 releases the resources of the image sensor module 105, the hardware abstraction layer module 101 checks the state of the soft landing flag, and when the state of the soft landing flag is in the completed state, the resource release operation of the image sensor module 105 is completed. In this way, the state of the soft landing flag can be checked, so that the resource release of the image sensor module 105 is marked after completion, ensuring that the camera motor completes the homing action when the resources are released.
[0052] In some embodiments of the present invention, the homing information includes the current position information of the motor, the target position information, the step length of each movement, and the interval time of each movement.
[0053] In some specific embodiments of the present invention, the number of times the motor is pushed during the motor homing process can be obtained through the motor current position information and the target position information, so as to facilitate the control of the camera motor.
[0054] In order to explain the above method more systematically, the following Figure 3The calling flow chart between the modules shown illustrates the camera motor homing process provided by an embodiment of the present invention.
[0055] S301 . When exiting a camera application, the hardware abstraction layer (Camera Hal) module 101 obtains the homing information of the camera motor from the data processing (ISP) algorithm module 102 .
[0056] S302 , the hardware abstraction layer module 101 transmits the homing information of the camera motor to the image sensor module 105 .
[0057] S303: The hardware abstraction layer module 101 returns after completing the transmission of the homing information.
[0058] S304, the image sensor module 105 transmits the received homing information of the camera motor to the camera driver module 103 through the first thread, and the camera driver module 103 performs the homing operation of the camera motor through the first thread, and updates the state of the soft landing flag to the completion state after completing the homing operation.
[0059] S305 , after the hardware abstraction layer module 101 completes the transmission of the homing information and returns, the data processing algorithm module 102 releases data resources through the second thread.
[0060] Specifically, the hardware abstraction layer module 101 performs deinitialization (Deinit) of the data processing (ISP) algorithm module 102 after S303.
[0061] S306 , the hardware abstraction layer module 101 completes the resource release of the data processing algorithm module 102 and returns.
[0062] S307 , after the hardware abstraction layer module 101 completes the release of the resources of the data processing algorithm module 102 and returns, the hardware abstraction layer module 101 releases the resources of the system integration module 104 .
[0063] Specifically, the hardware abstraction layer module performs deinitialization of the system integration module 104 .
[0064] S308 , the hardware abstraction layer module 101 completes the release of the resources of the system integration module 104 and then returns.
[0065] S309, after the hardware abstraction layer module 101 completes the release of the resources of the system integration module 104 and returns, the hardware abstraction layer module 101 transmits the information of the image sensor module 105 to the image sensor module 105, and the image sensor module 105 performs a deinitialization operation and starts to release resources.
[0066] S310 , the hardware abstraction layer module 101 returns after the image sensor module 105 starts releasing resources.
[0067] S311, the image sensor module 105 starts another thread to pass the image sensor module 105 information to the camera driver module 103, and the camera driver module 103 asynchronously completes the resource release of the image sensor module 105. When the camera driver module 103 completes the resource release of the image sensor module 105, it checks the state of the soft landing flag, and when the state of the soft landing flag is in the completion state, the resource release of the image sensor module 105 is completed.
[0068] Specifically, when the camera driving module 103 checks that the state of the soft landing flag is converted from Up to Down, the release of the resources of the image sensor module 105 is completed.
[0069] S312 , the hardware abstraction layer module 101 completes the release of the resources of the image sensor module 105 and returns, and then releases the resources of the image reading and writing module 106 .
[0070] S313, the hardware abstraction layer module 101 returns after completing the release of the resources of the image reading and writing module 106.
[0071] An embodiment of the present invention provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any of the methods described above.
[0072] The present invention also provides a computer-readable storage medium, wherein the computer program enables a computer to execute any of the above methods.
[0073] Although the embodiments of the present invention are described in detail above, it is obvious to those skilled in the art that various modifications and variations can be made to these embodiments. However, it should be understood that such modifications and variations are within the scope and spirit of the present invention as described in the claims. Moreover, the present invention described herein may have other embodiments and may be implemented or realized in a variety of ways.
Claims
1. A camera motor homing method, applied to a terminal device, wherein the software system of the terminal device includes a hardware abstraction layer module, a data processing algorithm module and a camera driver module, wherein: The method comprises: When exiting the camera application, the hardware abstraction layer module obtains the homing information of the camera motor of the terminal device from the data processing algorithm module; The hardware abstraction layer module transmits the homing information of the camera motor to the camera driving module; The camera driving module performs the camera motor reset when exiting the camera application according to the reset information of the camera motor through the first thread; The data processing algorithm module releases the data resources occupied by the camera during operation through the second thread; the first thread and the second thread are parallel in timing.
2. The method according to claim 1, characterized in that Returning the camera motor to its original position when exiting the camera application further includes: The camera driving module updates the status of the soft landing flag to a completion status.
3. The method according to claim 2, characterized in that After the hardware abstraction layer module transmits the homing information of the camera motor to the camera driving module, it also includes: The hardware abstraction layer releases the system integration module resources, image sensor module resources and image reading and writing module resources occupied by the camera during operation.
4. The method according to any one of claims 1 to 3, characterized in that: The homing information includes the current position information of the motor, the target position information, the step length of each movement and the interval time of each movement.
5. A camera motor homing system, applied to a terminal device, comprising a hardware abstraction layer module, a data processing algorithm module and a camera driver module, characterized in that: include: When exiting the camera application, the hardware abstraction layer module is used to obtain the homing information of the camera motor of the terminal device from the data processing algorithm module; The hardware abstraction layer module is further used to transmit the homing information of the camera motor to the camera driving module; The camera driving module is used to perform the camera motor reset when exiting the camera application according to the reset information of the camera motor through the first thread; The data processing algorithm module is used to release the data resources occupied by the camera during operation through the second thread; The first thread and the second thread are in parallel in terms of timing.
6. The system according to claim 5, characterized in that After the camera driving module resets the camera motor, the camera driving module is further used to: Update the status of the soft landing flag to the completed status.
7. The system according to claim 6, characterized in that After the hardware abstraction layer transmits the homing information of the camera motor to the camera driving module, the hardware abstraction layer is further used to: The system integration module resources, image sensor module resources and image reading and writing module resources occupied by the camera during operation are released.
8. The system according to any one of claims 5 to 7, characterized in that: The homing information includes the current position information of the motor, the target position information, the step length of each movement and the interval time of each movement.
9. An electronic device, characterized in that: include: at least one processor; and a memory communicatively coupled to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 4.
10. A computer-readable storage medium, characterized in that: Used to store a computer program, wherein the computer program enables a computer to execute the method according to any one of claims 1 to 4.
