Anti-shake method and electronic device

By using the application processor in the electronic device to provide power and the co-processor to determine the compensation value to drive the motor to adjust the posture of the camera module, the problem of high cost of optical anti-shake function is solved and the overall cost of the electronic device is reduced.

CN117750198BActive Publication Date: 2024-09-06HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311575109.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-22
Publication Date
2024-09-06
Estimated Expiration
2043-11-22

AI Technical Summary

Technical Problem

At this stage, the cost of camera modules integrating optical image stabilization (OIS) chips is relatively high, making it difficult to reduce the cost of the optical image stabilization function.

Method used

By using the application processor (AP) in the electronic device to provide power to the motor, and the co-processor (CP) determining the movement compensation value of the motor, driving the motor to adjust the posture of the camera module to compensate for jitter, avoiding additional power supply interface requirements, thus reducing the cost of CP.

Benefits of technology

It is possible to effectively reduce the overall cost of electronic equipment without increasing the cost of the co-processor, while maintaining the effect of the optical image stabilization function.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117750198B
    Figure CN117750198B
Patent Text Reader

Abstract

The embodiments of the present application are applicable to the field of camera technology, and provide an anti-shake method and an electronic device. The electronic device includes an application processor AP, a coprocessor CP and a camera module. The camera module includes a motor. The application in the electronic device runs in the AP. The method includes: in response to a first operation, starting the camera module, providing power to the motor through the AP, and determining the movement compensation value of the motor through the CP. The first operation includes starting the operation of the camera module, driving the motor to adjust the posture of the camera module based on the movement compensation value, and compensating for the jitter displacement of the camera module, so that the motor can drive the motor to move based on the power provided by the AP and the target value of the motor movement provided by the CP, so as to push the lens to move. That is to say, the embodiments of the present application do not need to set an additional power interface on the CP, and use the power interface in the AP that is compatible with the motor to provide power to the motor, thereby reducing the cost of the CP and the cost of the electronic device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of camera technology, and more specifically, to an anti-shake method and an electronic device. Background Art

[0002] With the continuous development of camera-related technologies and the increasing demand for camera performance from users, the optical image stabilization (OIS) function has become one of the essential functions of electronic device cameras. When users use electronic devices with OIS-enabled cameras to take photos, the OIS function can compensate for the virtual images caused by hand shaking during shooting, achieve clear imaging, and improve the shooting effect.

[0003] Usually, the OIS function is implemented through an OIS chip, which is usually integrated into a camera module. The OIS chip includes a micro control unit (MCU) and a motor driver (VCM driver). The MCU is used to calculate the compensation distance that the camera module needs to move based on the camera module's jitter, and the VCM driver is used to drive the camera module to move according to the compensation distance output by the MCU. However, at this stage, camera modules that integrate OIS chips are usually more expensive.

[0004] Based on this, how to reduce the cost of optical image stabilization has become an urgent problem to be solved. Summary of the invention

[0005] The present application provides an anti-shake method, which can reduce the cost of optical image stabilization.

[0006] In a first aspect, an anti-shake method is provided. The method is applied to an electronic device, the electronic device includes an application processor AP, a coprocessor CP and a camera module, the camera module includes a motor, and an application in the electronic device runs in the AP. The method includes:

[0007] In response to the first operation, starting the camera module;

[0008] Providing electrical energy to the motor through the AP and determining a movement compensation value of the motor through the CP, the first operation includes starting an operation of the camera module;

[0009] The driving motor adjusts the position and posture of the camera module based on the movement compensation value to compensate for the jitter displacement of the camera module.

[0010] The anti-shake method provided in the embodiment of the present application is applied to an electronic device, wherein the electronic device includes an application processor AP, a coprocessor CP and a camera module, wherein the camera module includes a motor, and an application in the electronic device runs in the AP. The method includes: in response to a first operation, starting the camera module, providing power to the motor through the AP, and determining a movement compensation value of the motor through the CP. The first operation includes starting the operation of the camera module, driving the motor to adjust the posture of the camera module based on the movement compensation value, and compensating for the shaking displacement of the camera module, so that the motor can drive the motor to move based on the power provided by the AP and the target value of the motor movement provided by the CP, and push the lens to move, so that the lens can move from other positions of the photographed object that are not in the focal center of the lens due to the shaking of the lens back to the focal center of the lens. That is to say, the embodiment of the present application does not need to set an additional power interface on the CP, and uses the power interface in the AP that is compatible with the motor to provide power to the motor, thereby reducing the cost of the CP and thus reducing the cost of the electronic device.

[0011] In combination with the first aspect, in some embodiments of the first aspect, an optical image stabilization OIS module is running in the AP, an OIS management module is running in the CP, and the movement compensation value of the motor is determined through the CP, including: the OIS module sends a first instruction to the OIS management module running in the CP, the first instruction is used to instruct the determination of the jitter displacement of the camera module; the OIS management module determines the movement compensation value in response to the first instruction.

[0012] In combination with the first aspect, in some embodiments of the first aspect, the OIS module sends a first instruction to the OIS management module running in the CP in response to the first operation, including: the OIS module sends a second instruction to the non-camera process management NCS module in response to the first operation, the second instruction is used to establish a first interface, the first interface is a functional interface for communication between multi-processor processes; the OIS module running in the AP sends the first instruction to the OIS management module running in the CP through the first interface.

[0013] In combination with the first aspect, in some embodiments of the first aspect, the OIS management module determines the motion compensation value in response to the first instruction, including: the OIS management module creates OIS resources in response to the first instruction; and determines the motion compensation value through the OIS resources.

[0014] In combination with the first aspect, in some embodiments of the first aspect, the OIS resource includes an OIS algorithm submodule and a gyroscope data acquisition submodule, and determining the motion compensation value through the OIS resource includes: acquiring the jitter displacement of the camera module through the gyroscope data acquisition submodule; calculating and processing the jitter displacement of the camera module using a compensation algorithm through the OIS algorithm submodule to obtain the motion compensation value.

[0015] In combination with the first aspect, in some embodiments of the first aspect, the OIS resource also includes a timer, and the jitter displacement of the camera module is obtained through the gyroscope data acquisition submodule, including: based on the timing period of the timer, periodically obtaining the jitter displacement of the camera module through the gyroscope data acquisition submodule; based on the timing period of the timer, periodically calculating and processing the jitter displacement of the camera module through the OIS algorithm submodule using a compensation algorithm to obtain a motion compensation value.

[0016] In combination with the first aspect, in some embodiments of the first aspect, the method also includes: in response to the second operation, the OIS module running in the AP sends a third instruction to the OIS management module running in the CP, the third instruction is used to instruct the destruction of OIS resources, and the second operation includes an operation of turning off the camera module; the OIS management module destroys the OIS resources in response to the third instruction.

[0017] In combination with the first aspect, in some embodiments of the first aspect, after the OIS management module destroys the OIS resources in response to the third instruction, the method further includes: the OIS management module sends a fourth instruction to the camera module, and the fourth instruction is used to instruct the camera module to power off.

[0018] The anti-shake method provided in the embodiment of the present application responds to the operation of shutting down the camera module, and the OIS module running in the AP sends an instruction to destroy OIS resources to the OIS management module in the CP through the queue message interface. The OIS management module stops the timer and destroys the OIS resources in response to the instruction to destroy the OIS resources, and sends a message indicating that the timer has been stopped to the OIS module after stopping the timer, so that the OIS module instructs the camera module to power off based on the message that the timer has been stopped. This is equivalent to destroying the OIS resources in the CP first and then instructing the camera module to power off. Therefore, the OIS resources will not continue to perform corresponding processing after the camera module is powered off, which also avoids the situation where the data obtained after the OIS resources perform the corresponding processing is not used, thereby avoiding the situation where these unused data cause abnormal operation in the CP.

[0019] In combination with the first aspect, in some embodiments of the first aspect, in response to the second operation, the OIS module sends a third instruction to the OIS management module running in the CP, including: in response to the second operation, the OIS module sends the third instruction to the OIS management module running in the CP, and sends a fifth instruction to the camera module, the fifth instruction being used to instruct the camera module to power off after a preset time period.

[0020] The anti-shake method provided in the embodiment of the present application responds to the operation of shutting down the camera module. The OIS module running in the AP sends an instruction to destroy OIS resources to the OIS management module in the CP through the queue message interface, and at the same time sends a power-off instruction to the camera module. The power-off instruction instructs the camera module to power off if the power-off instruction sent by the OIS management module is not received within a preset time period. This avoids the situation where the OIS management module in the CP cannot send the power-off instruction to the camera module in time due to a communication failure, thereby avoiding the situation where the camera module is unable to power off for a long time, thereby saving system power consumption.

[0021] In combination with the first aspect, in some embodiments of the first aspect, the method also includes: the camera module responds to the fifth instruction and performs a power-off operation if the fourth instruction is not received within a preset time period, and the fourth instruction is an instruction instructing the camera module to power off after the OIS management module destroys the OIS resources.

[0022] The anti-shake method provided in the embodiment of the present application responds to the operation of shutting down the camera module. The OIS module running in the AP sends an instruction to destroy OIS resources to the OIS management module in the CP through the queue message interface, and at the same time sends a power-off instruction to the camera module. The power-off instruction instructs the camera module to power off if the power-off instruction sent by the OIS management module is not received within a preset time period. This avoids the situation where the OIS management module in the CP cannot send the power-off instruction to the camera module in time due to a communication failure, thereby avoiding the situation where the camera module is unable to power off for a long time, thereby saving system power consumption.

[0023] In a second aspect, an anti-shake device is provided, comprising a unit for executing any one of the methods in the first aspect. The device may be a server, a terminal device, or a chip in a terminal device. The device may include an input unit and a processing unit.

[0024] When the device is a terminal device, the processing unit may be a processor, and the input unit may be a communication interface; the terminal device may also include a memory, which is used to store computer program code. When the processor executes the computer program code stored in the memory, the terminal device executes any one of the methods in the first aspect.

[0025] When the device is a chip in a terminal device, the processing unit may be a processing unit inside the chip, and the input unit may be an output interface, a pin or a circuit, etc.; the chip may also include a memory, which may be a memory inside the chip (for example, a register, a cache, etc.) or a memory located outside the chip (for example, a read-only memory, a random access memory, etc.); the memory is used to store computer program code, and when the processor executes the computer program code stored in the memory, the chip executes any one of the methods in the first aspect.

[0026] In one possible implementation, a memory is used to store computer program codes; a processor executes the computer program codes stored in the memory, and when the computer program codes stored in the memory are executed, the processor is used to perform: in response to a first operation, starting the camera module; providing power to the motor through the AP, and determining the movement compensation value of the motor through the CP, the first operation including starting the operation of the camera module; driving the motor to adjust the posture of the camera module based on the movement compensation value to compensate for the jitter displacement of the camera module.

[0027] According to a third aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program code. When the computer program code is executed by a device, the device executes any one of the anti-shake methods according to the first aspect.

[0028] In a fourth aspect, a computer program product is provided, the computer program product comprising: a computer program code, when the computer program code is executed by an anti-shake device, the anti-shake device executes any one of the device methods in the first aspect.

[0029] An anti-shake method and an electronic device provided by an embodiment of the present application, wherein the electronic device includes an application processor AP, a coprocessor CP and a camera module, the camera module includes a motor, and an application in the electronic device runs in the AP. The method includes: in response to a first operation, starting the camera module, providing power to the motor through the AP, and determining a movement compensation value of the motor through the CP. The first operation includes starting the operation of the camera module, driving the motor to adjust the posture of the camera module based on the movement compensation value, and compensating for the shaking displacement of the camera module, so that the motor can drive the motor to move based on the power provided by the AP and the target value of the motor movement provided by the CP, and push the lens to move, so that the lens can move from other positions of the photographed object that are not in the focal center of the lens due to the shaking of the lens back to the focal center of the lens. That is to say, the embodiment of the present application does not need to set an additional power interface on the CP, and uses the power interface in the AP that is compatible with the motor to provide power to the motor, thereby reducing the cost of the CP and thereby reducing the cost of the electronic device. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 It is a schematic diagram of the structure of an electronic device;

[0031] Figure 2 It is a schematic diagram of the structure of an electronic device;

[0032] Figure 3 is a hardware system diagram of an electronic device applicable to the present application;

[0033] Figure 4 is a schematic diagram of a software system of an electronic device applicable to the present application;

[0034] Figure 5 It is a schematic diagram of an application scenario provided by an embodiment of the present application;

[0035] Figure 6 is a flowchart of an anti-shake method provided in an embodiment of the present application;

[0036] Figure 7 It is a schematic diagram of the displacement relationship of lens shake;

[0037] Figure 8 is a flowchart of an anti-shake method provided in an embodiment of the present application;

[0038] Fig. 9 is a flowchart of an anti-shake method provided in an embodiment of the present application;

[0039] Fig.10 is a flowchart of an anti-shake method provided in an embodiment of the present application;

[0040] Fig.11 is a flowchart of an anti-shake method provided in an embodiment of the present application;

[0041] Fig.12 is a schematic diagram of an anti-shake device provided by the present application;

[0042] Fig.13 It is a schematic diagram of an anti-shake electronic device provided by the present application. DETAILED DESCRIPTION

[0043] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.

[0044] In the following, the terms "first", "second", and "third" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first", "second", and "third" may explicitly or implicitly include one or more of the features.

[0045] To facilitate understanding, some of the examples given are provided for reference to the description of concepts related to the embodiments of the present application.

[0046] 1. Application Process (AP).

[0047] AP is the main processor in the mobile phone. The operation of the operating system and applications in the mobile phone depends on AP.

[0048] 2. Coprocessor (CP).

[0049] CP is the processor in the mobile phone that assists AP in its work. It usually handles simple tasks such as virtual reality, image processing, high-fidelity sound quality (HIFI), high dynamic range imaging (HDR), and driving sensors.

[0050] It should be noted that, since the AP and CP are two independent processors, a processing task is usually run on the AP alone or on the CP alone. If a processing task needs to be run on both the AP and the CP, the timing for the processing task needs to be aligned.

[0051] 3. Motor in the camera module.

[0052] The motor in the camera module is usually a voice coil motor (VCM), which is a device that converts electrical energy into mechanical energy and can achieve linear and limited swing angle movement. VCM uses the interaction between the magnetic poles in the magnetic field generated by the magnetic field from the permanent magnet and the energized coil conductor to produce regular movement.

[0053] 4. Optical image stabilization (OIS).

[0054] OIS refers to image stabilization technology that uses mechanical motion to compensate for sudden movement and shaking. For example, OIS refers to adjusting the position of optical components, such as lenses, in cameras or other similar imaging instruments to avoid or reduce the problem of poor imaging caused by instrument jitter during the capture of optical signals, thereby improving image quality.

[0055] Among them, adjusting the posture of the optical component can be achieved by driving the optical component through the above-mentioned VCM.

[0056] For example, Figure 1 As shown, the electronic device includes a system on chip (System on Chip, Soc), a gyroscope (Gyro) and a camera module, an OIS controller integrated in the camera module, and the OIS controller includes a microcontroller unit (Microcontroller Unit, MCU) and a motor driver (VCM driver). The gyroscope sends the collected movement data of the lens to the MCU, and the MCU calculates the compensation value for the lens shake based on the movement data of the lens and sends it to the motor. Then the motor driver drives the voice coil motor in the camera module based on the compensation value to push the lens to move, compensate for the displacement of the lens caused by the lens shake, and avoid the problem of poor imaging effect caused by the lens shake.

[0057] Since the camera module integrated with the OIS controller is usually expensive, the SoC in the electronic device can be used to calculate the compensation value for the lens shake. Figure 2 As shown, the electronic device includes a system-on-chip (Systemon Chip, Soc), a gyroscope (Gyro) and a camera module. There is no integrated OIS controller in the camera module, but there is still a motor driver (VCM driver). The gyroscope sends the collected lens movement data to the digital signal processor unit (Digital Signal Processor, DSP) in the Soc. The DSP calculates the compensation value for the lens shake based on the lens movement data and sends it to the motor. Then the motor driver drives the voice coil motor in the camera module based on the above compensation value to push the lens to move, compensate for the displacement of the lens caused by the lens shake, and avoid the problem of poor imaging effect caused by the lens shake. Among them, the method of calculating the compensation value of the lens shake by the DSP in the Soc can be called SOIS.

[0058] However, electronic devices usually use the DSP in the CP to calculate the compensation value of the lens shake, so it is necessary to provide power to the motor in the camera component through the CP. In this case, a customized power connector is required to provide power to the CP, which increases the cost of the electronic device.

[0059] In view of this, an anti-shake method provided in an embodiment of the present application is applied to an electronic device, wherein the electronic device includes an application processor AP, a coprocessor CP and a camera module, the camera module includes a motor, and an application in the electronic device runs in the AP. The method includes: in response to a first operation, starting the camera module, providing power to the motor through the AP, and determining a movement compensation value of the motor through the CP. The first operation includes starting the operation of the camera module, driving the motor to adjust the posture of the camera module based on the movement compensation value, and compensating for the jitter displacement of the camera module, so that the motor can drive the motor to move based on the power provided by the AP and the target value of the motor movement provided by the CP, and push the lens to move, so that the lens can move from other positions of the photographed object that are not in the focal center of the lens due to the lens shaking back to the focal center of the lens. That is to say, the embodiment of the present application does not need to set an additional power interface on the CP, and uses the power interface in the AP that is compatible with the motor to provide power to the motor, thereby reducing the cost of the CP and thereby reducing the cost of the electronic device.

[0060] The anti-shake method provided in the embodiment of the present application can be applied to electronic devices. Optionally, the electronic device includes a terminal device, which can also be called a terminal, a user equipment (UE), a mobile station (MS), a mobile terminal (MT), etc. The terminal device can be a mobile phone, a smart TV, a wearable device, a tablet computer (Pad), a computer with wireless transceiver function, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical surgery, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, etc. The embodiment of the present application does not limit the specific technology and specific device form adopted by the terminal device.

[0061] For example, Figure 31 shows a schematic diagram of the structure of the electronic device 100. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0062] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0063] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

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

[0065] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 communicates with the touch sensor 180K through the I2C bus interface, thereby realizing the touch function of the electronic device 100.

[0066] In one possible scenario, the processor 110 communicates with the camera module (eg, camera 193) via an I2C bus interface, driving a motor in the camera module to move the lens to achieve optical image stabilization.

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

[0068] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0069] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0070] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0071] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0072] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.

[0073] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0074] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0075] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0076] The gyro sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyro sensor 180B. The gyro sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyro sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyro sensor 180B can also be used for navigation and somatosensory game scenes.

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

[0078] It should be noted that the motor 191 and the voice coil motor in the camera module may not be the same motor. The voice coil motor is usually integrated in the camera module to drive the lens to move, offset the shake of the electronic device 100, and realize anti-shake motor.

[0079] It should be noted that any electronic device mentioned in the embodiments of the present application may include more or fewer modules in the electronic device 100.

[0080] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. Since the electronic device provided in the embodiment of the present application includes an AP and a CP, the operating system is usually run in the AP. The following takes the layered architecture Android system of the AP as an example to illustrate the software structure of the electronic device 100.

[0081] Figure 4It is a software structure block diagram of the electronic device 100 according to an embodiment of the present application.

[0082] The layered architecture of the electronic device 100 divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system running in the AP is divided into four layers, from top to bottom, namely, the application layer, the application framework layer, the Android runtime and the system library, the hardware abstraction layer HAL, and the kernel layer.

[0083] The application layer can include a series of application packages.

[0084] like Figure 4 As shown, the application package may include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications.

[0085] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0086] like Figure 4 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, a camera service, and the like.

[0087] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0088] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0089] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.

[0090] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including connecting, hanging up, etc.).

[0091] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0092] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.

[0093] The camera service is used to call up the camera process in the hardware abstraction layer in response to the operation of starting the camera application.

[0094] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.

[0095] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.

[0096] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0097] The system library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0098] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.

[0099] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0100] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0101] A 2D graphics engine is a drawing engine for 2D drawings.

[0102] The hardware abstraction layer includes a camera process, wherein the camera process includes an OIS module and a non-camera sensor.

[0103] The OIS module is used to generate an optical image stabilization instruction, wherein the optical image stabilization instruction is used to indicate the displacement that needs to be supplemented due to lens shake calculated by an algorithm.

[0104] Non-camera sensors are used to manage non-camera sensors related to the camera module. For example, non-camera sensors can manage the voice coil motor used to drive the lens movement in the camera module, the gyroscope used to collect lens movement data, etc.

[0105] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, sensor driver, Wi-Fi driver, etc.

[0106] The software framework of CP may include a sensor hub layer, which includes an OIS management module, a gyroscope management module, a gyroscope driver, a serial peripheral interface (SPI) driver, an inter-integrated circuit (I2C) driver, and the like.

[0107] The OIS management module may include an OIS algorithm submodule, a gyroscope driving submodule and a motor driving submodule. The OIS algorithm submodule is used to calculate the displacement that needs to be supplemented due to lens shaking based on the gyroscope data.

[0108] It should be understood that since the AP and CP are two independent processors, they cannot communicate directly. Therefore, the OIS module in the AP can establish a queue message interface through the non-camera sensor and send optical image stabilization instructions to the OIS management module in the CP through the queue message interface.

[0109] It should be noted that the electronic device mentioned in the embodiments of the present application may include more or fewer modules in the above-mentioned electronic device.

[0110] The application scenarios provided by the embodiments of the present application are described below with reference to the accompanying drawings.

[0111] The present application implements the application of the optical image stabilization method provided by the stereo camera in electronic devices. In one possible case, the above-mentioned electronic device refers to a mobile phone. A camera module is provided in the mobile phone, wherein the camera module includes a lens, a gyroscope and a voice coil motor. It is understandable that during the process of capturing images, the lens in the camera module may shake due to the shaking of the user's hands or due to the adjustment of the focal length, which in turn causes the quality of the image captured by the lens to deteriorate. Therefore, the voice coil motor in the camera module calculates the compensation value for the lens shake based on the lens shake data collected by the gyroscope, and then drives the voice coil motor to move the lens based on the compensation value to offset the lens shake. Among them, if Figure 5 As shown, the voice coil motor driver is connected to the AP and CP respectively. The AP provides power to the voice coil motor. The CP determines the compensation value and sends the compensation value to the voice coil motor through the I2C bus, so that the voice coil motor drives the lens to move based on the compensation value.

[0112] It should be noted that since AP is the main processor, it is usually compatible with the power supply of the motor. The AP provides power to the voice coil motor without the need for an additional power interface. However, CP is a coprocessor. If the CP is used to provide power to the motor, an additional power interface is required, which increases the cost of the CP and, in turn, the cost of the mobile phone.

[0113] The above is an example of an application scenario and does not limit the application scenario of the present application.

[0114] Combine the following Figures 6 to 11 The anti-shake method provided in the embodiment of the present application is described in detail.

[0115] Figure 6 A flowchart of an anti-shake method provided in an embodiment of the present application is shown in FIG. Figure 6 As shown, the method is applied to an electronic device, the electronic device includes an application AP, a CP and a camera module, the camera module includes a motor, the application in the electronic device runs in the AP, the motor is connected to the AP and the CP respectively, and the method includes:

[0116] S101 . In response to an operation of starting a camera module, calling up a camera process in an AP, wherein the camera process includes an OIS module and a non-camera sensor (NCS) management module.

[0117] Among them, the operation of starting the camera module can be an operation in which the user clicks on the control of the camera application on the mobile phone desktop; it can also be an operation in which the user wakes up the camera application through voice; the embodiments of the present application do not limit this. It is understandable that the camera application is usually run in the AP. In response to the operation of starting the camera module, the camera application of the application layer calls up the camera process (camera HAL) in the HAL layer through the camera service of the application framework layer. The camera application can be a built-in camera application in the electronic device system, or it can be a third-party camera application, and the embodiments of the present application do not limit this.

[0118] The camera process includes an OIS module and a non-camera sensor management module. The OIS module includes an OIS submodule and an SOIS submodule. Figure 4The OIS submodule can be used to execute the process of determining the jitter compensation value when the computing unit is integrated in the camera module, and the SOIS submodule can be used to execute the process of determining the jitter compensation value when the computing unit is not integrated in the camera module. The computing unit integrated in the camera module can refer to Figure 1 The MCU in the OIS controller shown is not integrated in the camera module. The computing unit may refer to Figure 2 The DSP in the Soc shown. The anti-shake method provided in the embodiment of the present application may refer to a method for determining a shake compensation value through a SOIS submodule. The NCS management module can be used to manage all non-camera sensors called in the process of enabling the camera process, for example, managing the voice coil motor used to drive the lens movement, the gyroscope used to collect the lens displacement, etc., which is not limited in the embodiment of the present application.

[0119] S102: The OIS module generates an instruction for establishing an interface.

[0120] The instruction to establish the interface is used to instruct the establishment of a communication interface between the CP and the AP. The OIS module can generate the instruction to establish the interface through the SOIS submodule therein. The instruction to establish the interface can be an instruction generated by the OIS module when creating a camera process.

[0121] S103: The OIS module sends an instruction for establishing an interface to the non-camera sensor management module.

[0122] The OIS module may send an instruction for establishing an interface to the non-camera sensor management module through the SOIS submodule, wherein the instruction for establishing an interface is equivalent to the second instruction.

[0123] S104: The non-camera sensor management module creates a first interface based on the instruction to establish the interface.

[0124] The first interface may refer to a queue message interface (QMI). Since the AP and the CP are two different processors, if the AP and the CP want to transmit messages, the timing between the AP and the CP needs to be aligned. Therefore, the OIS module may first create a QMI through the NCS management module, so that the OIS module can send messages to the modules in the CP through the QMI.

[0125] In order to avoid the loss of messages transmitted between AP and CP, all message transmission processes between AP and CP need to be transmitted through QMI. During the message transmission process, QMI will persist the message to be processed until the message is processed, which can avoid the loss of messages transmitted between AP and CP.

[0126] S105. The OIS module sends an initialization message (initate command) to the OIS management module in the CP through the queue message interface.

[0127] The initialization message is used to instruct the OIS management module to create OIS resources. It should be understood that the initialization message is equivalent to the first instruction.

[0128] S106 . The OIS management module creates OIS resources and a timer in response to the initialization message, wherein the OIS resources include an OIS algorithm submodule.

[0129] Among them, the timer can be used to instruct the OIS resource to periodically process anti-shake tasks (collecting gyroscope data, calculating the compensation value of lens shake, etc.). For example, the timer can instruct the OIS resource to collect gyroscope data once every 1ms, and calculate the compensation value of lens shake based on the data collected by the gyroscope.

[0130] The OIS resource includes an OIS algorithm submodule, which can be used to call the OIS algorithm in the algorithm library, calculate the offset of the lens shake collected by the gyroscope, and obtain a compensation value for the lens shake.

[0131] S107: The OIS algorithm submodule periodically obtains the lens shake offset collected by the gyroscope based on the timer.

[0132] The timer may refer to a 1ms timer, and the OIS algorithm submodule periodically obtains the lens shake offset collected by the gyroscope based on the timer, that is, the OIS algorithm submodule obtains the lens shake offset collected by the gyroscope every 1ms. It should be understood that when determining the displacement of an electronic device, a coordinate system is usually formed with a vertex of the electronic device as the origin. For example, Figure 7 As shown in (a) of FIG. 1 , the vertex at the upper left corner of the electronic device is used as the origin, and the two intersecting axes of the electronic device are used as the X-axis and the Y-axis to form a coordinate system. At time T0, the coordinates of the center point of the lens are (X0, Y0). Due to the shaking of the electronic device, at time T1, as shown in FIG. Figure 7 As shown in (b), the coordinates of the center point of the lens relative to the origin of the electronic device at time T0 are (X1, Y1), where the difference between (X0, Y0) and (X1, Y1) is the offset of the lens shake from time T0 to time T1. The gyroscope can collect the movement distance of the lens along the X-axis direction and the movement distance of the lens along the Y-axis direction caused by the lens shake, and obtain the offset of the lens shake.

[0133] It can be understood that the voice coil motor provided in the embodiment of the present application can be a motor that drives the lens to move along the X-axis and Y-axis directions.

[0134] S108: The OIS algorithm submodule periodically obtains the OIS mode determined by the OIS module in the AP based on the timer.

[0135] The timer may refer to a 1ms timer, and the OIS algorithm submodule periodically obtains the OIS mode determined by the OIS module in the AP based on the timer, that is, the OIS algorithm submodule determines the OIS mode from the OIS module in the AP every 1ms. The OIS mode may include a centering mode and a mode for anti-shake following the mobile phone shake.

[0136] S109 , the OIS algorithm submodule uses a preset anti-shake algorithm to perform calculation based on the lens shake offset and the OIS mode to obtain a shake compensation value.

[0137] The preset anti-shake algorithm can be a neural network model or a mathematical model, and the embodiments of the present application are not limited to this. In one possible case, the preset anti-shake algorithm can also be a filtering algorithm. The OIS algorithm submodule can call up the preset anti-shake algorithm from the algorithm library, input the lens shake offset and the OIS mode into the preset anti-shake algorithm, and obtain the shake compensation value. It can be understood that lens shake will cause the photographed object to move from the focal center of the lens to other positions, and the shake compensation value is to move the photographed object from other positions back to the focal center of the lens, so that the photographed object remains in the focal center of the lens, improving the imaging effect.

[0138] S110 . The OIS algorithm submodule sends a jitter compensation value to the motor driving submodule.

[0139] The motor drive module may be a submodule in the OIS management module, and the OIS algorithm module may directly send the jitter compensation value to the motor drive module.

[0140] S111 . The motor driving submodule drives the motor to move based on the jitter compensation value to compensate for the jitter displacement of the lens.

[0141] The anti-shake method provided in the embodiment of the present application provides electric energy to the motor through the AP, and obtains the shake compensation value through the CP calculation, so that the motor can drive the motor to move based on the electric energy provided by the AP and the target value of the motor movement provided by the CP, and push the lens to move, so that the lens can move from other positions where the photographed object is not in the focal center of the lens due to the lens shake back to the focal center of the lens, thereby improving the imaging effect of the image. At the same time, the motor can be driven to move based on the electric energy provided by the AP and the target value of the motor movement provided by the CP, and push the lens to move, so that the lens can move from other positions where the photographed object is not in the focal center of the lens due to the lens shake back to the focal center of the lens. That is to say, the embodiment of the present application does not need to set an additional power interface on the CP, and uses the power interface in the AP that is compatible with the motor to provide electric energy to the motor, thereby reducing the cost of the CP, and thereby reducing the cost of the electronic device.

[0142] The electronic device can also further improve the imaging command by combining electronic image stabilization (EIS) based on the above method to correct the position of the lens.

[0143] Optionally, electronic image stabilization is performed by the AP.

[0144] Among them, EIS needs to obtain the three-axis angle and three-axis translation posture information of the electronic device based on the gyroscope and accelerometer, and reproject the image taken by the electronic device according to this posture information to form an image under a specific virtual posture. If this virtual posture is a series of stable postures, then a stable video can be obtained. AP can obtain hall data and perform electronic image stabilization based on the hall data. Among them, the hall data can be used to indicate the position of the motor.

[0145] After using the above anti-shake method to obtain the jitter compensation value, the user will close the camera application. In order to avoid the OIS resources still being processed after the camera module is powered off, the data obtained after processing is not used. These unused data may cause abnormal operation in the CP. The anti-shake method provided in the embodiment of the present application can power off the camera module after releasing the OIS resources. Figure 8 The illustrated embodiment is described in detail.

[0146] Figure 8 A flowchart of another anti-shake method provided in an embodiment of the present application is shown as follows: Figure 8 As shown, the method includes:

[0147] S201: In response to the operation of shutting down the camera module, the OIS module sends an instruction to destroy OIS resources to the OIS management module in the CP through the queue message interface.

[0148] Among them, the operation of turning off the camera module can be an operation in which the user clicks on the control of the camera application on the mobile phone desktop; it can also be an operation in which the user turns off the camera application through a voice assistant; the embodiment of the present application does not limit this. It can be understood that the camera application is usually run in the AP. In response to the operation of turning off the camera module, the OIS module in the camera process can send an instruction to destroy OIS resources to the OIS management module through QMI. Among them, the OIS resources include the above-mentioned OIS algorithm submodule, and destroying the OIS resources can refer to releasing the OIS algorithm submodule.

[0149] Among them, the instruction to destroy the OIS resources is equivalent to the third instruction.

[0150] S202: The OIS module sends a power-off instruction to the camera module.

[0151] The power-off instruction is used to instruct the camera module to power off when the camera module does not receive an instruction (equivalent to the fourth instruction) sent by the OIS management module to instruct the camera module to power off within a preset time period.

[0152] It should be noted that the power-off instruction is sent to the camera module by the OIS module running in the AP, which is equivalent to the fifth instruction and can be used to instruct the camera module to perform power-off processing after a preset time.

[0153] S203: The camera module determines whether the waiting time exceeds a preset time.

[0154] The waiting time may refer to the time from when the camera module receives the power-off instruction to when the camera module receives the message of stopping the timer sent by the OIS management module. If the waiting time exceeds the preset time, S204 is executed.

[0155] S204, power off the camera module.

[0156] The anti-shake method provided in the embodiment of the present application responds to the operation of shutting down the camera module. The OIS module running in the AP sends an instruction to destroy OIS resources to the OIS management module in the CP through the queue message interface, and at the same time sends a power-off instruction to the camera module. The power-off instruction instructs the camera module to power off if the power-off instruction sent by the OIS management module is not received within a preset time period. This avoids the situation where the OIS management module in the CP cannot send the power-off instruction to the camera module in time due to a communication failure, thereby avoiding the situation where the camera module is unable to power off for a long time, thereby saving system power consumption.

[0157] S205 . The OIS management module stops the timer and destroys the OIS resources based on the instruction to destroy the OIS resources.

[0158] After the timer stops, the OIS algorithm submodule stops acquiring the gyroscope data and stops calculating the jitter compensation value based on the gyroscope data. Destroying the OIS algorithm submodule is equivalent to releasing the memory space occupied by the OIS algorithm submodule.

[0159] S206 . After the timer stops, the OIS management module sends a message indicating that the timer has stopped to the OIS module through the queue message interface.

[0160] It should be understood that after the timer stops, the OIS algorithm submodule stops acquiring the gyroscope data and stops calculating the jitter compensation value based on the gyroscope data. Therefore, the CP will no longer continue to perform the process of calculating the jitter compensation value, nor will it continue to send the jitter compensation value to the motor, and thus no abnormal operation will occur in the CP.

[0161] Among them, the message that the timer has stopped can be equivalent to the fourth instruction. After receiving the fourth instruction, the OIS module can instruct the camera module to power off, that is, stop providing power to the camera module, so that the camera module cannot continue to capture images.

[0162] It should be noted that the fifth instruction is sent to the camera module by the OIS module running in the AP. The fourth instruction is sent to the camera module by the OIS management module running in the CP. Moreover, both the fourth instruction and the fifth instruction instruct the camera module to perform power-off processing.

[0163] S207 . The OIS module responds to the message that the timer has stopped by deregistering the queue message interface and instructing the camera module to power off.

[0164] It can be understood that the queue message interface is a communication interface established for communication between the AP and the CP. After the OIS resources in the CP are cancelled, there is no need for communication between the AP and the CP. Therefore, the queue message interface can be cancelled to avoid the situation where resources in the system are occupied. Among them, the queue message interface is equivalent to the first interface.

[0165] S208, the camera module is powered off.

[0166] The anti-shake method provided in the embodiment of the present application responds to the operation of shutting down the camera module, and the OIS module running in the AP sends an instruction to destroy OIS resources to the OIS management module in the CP through the queue message interface. The OIS management module stops the timer and destroys the OIS resources in response to the instruction to destroy the OIS resources, and sends a message indicating that the timer has been stopped to the OIS module after stopping the timer, so that the OIS module instructs the camera module to power off based on the message that the timer has been stopped. This is equivalent to destroying the OIS resources in the CP first and then instructing the camera module to power off. Therefore, the OIS resources will not continue to perform corresponding processing after the camera module is powered off, which also avoids the situation where the data obtained after the OIS resources perform the corresponding processing is not used, thereby avoiding the situation where these unused data cause abnormal operation in the CP.

[0167] Fig. 9 A flowchart of an anti-shake method provided in another embodiment of the present application is shown in FIG. Fig. 9 As shown, the method is applied to an electronic device, the electronic device includes an application processor AP, a coprocessor CP and a camera module, the camera module includes a motor, and an application in the electronic device runs in the AP. The method includes:

[0168] S301: In response to a first operation, start a camera module.

[0169] S302, providing electric energy to the motor through AP, and determining the movement compensation value of the motor through CP, the first operation includes starting the operation of the camera module.

[0170] S303 , driving the motor to adjust the position and posture of the camera module based on the movement compensation value to compensate for the shaking displacement of the camera module.

[0171] The anti-shake method provided in the embodiment of the present application is applied to an electronic device, wherein the electronic device includes an application processor AP, a coprocessor CP and a camera module, wherein the camera module includes a motor, and an application in the electronic device runs in the AP. The method includes: in response to a first operation, starting the camera module, providing power to the motor through the AP, and determining a movement compensation value of the motor through the CP. The first operation includes starting the operation of the camera module, driving the motor to adjust the posture of the camera module based on the movement compensation value, and compensating for the shaking displacement of the camera module, so that the motor can drive the motor to move based on the power provided by the AP and the target value of the motor movement provided by the CP, and push the lens to move, so that the lens can move from other positions of the photographed object that are not in the focal center of the lens due to the shaking of the lens back to the focal center of the lens. That is to say, the embodiment of the present application does not need to set an additional power interface on the CP, and uses the power interface in the AP that is compatible with the motor to provide power to the motor, thereby reducing the cost of the CP and thus reducing the cost of the electronic device.

[0172] In one embodiment, Fig.10 As shown, an optical image stabilization OIS module is running in the AP, and an OIS management module is running in the CP. The method includes:

[0173] S401: In response to a first operation, start a camera module.

[0174] S402 , providing electrical energy to the motor via the AP.

[0175] S403: The OIS module sends a first instruction to the OIS management module running in the CP, where the first instruction is used to instruct to determine the jitter displacement of the camera module and determine the movement compensation value of the motor through the CP.

[0176] Optionally, the OIS module sends a first instruction to the OIS management module running in the CP, including the following steps:

[0177] S4031. In response to the first operation, the OIS module sends a second instruction to the non-camera process management NCS module, where the second instruction is used to establish a first interface, which is a functional interface for communication between multiple processor processes.

[0178] S4032: The OIS module running in the AP sends a first instruction to the OIS management module running in the CP through the first interface.

[0179] S404: The OIS management module determines a motion compensation value in response to the first instruction.

[0180] Optionally, the OIS management module determines the motion compensation value in response to the first instruction, comprising the following steps:

[0181] S4041. The OIS management module creates OIS resources in response to the first instruction.

[0182] S4042: Determine a motion compensation value through OIS resources.

[0183] Among them, the OIS resources include an OIS algorithm submodule and a gyroscope data acquisition submodule. The motion compensation value is determined through the OIS resources, including: obtaining the jitter displacement of the camera module through the gyroscope data acquisition submodule; calculating and processing the jitter displacement of the camera module using a compensation algorithm through the OIS algorithm submodule to obtain the motion compensation value.

[0184] The implementation principle and beneficial effects of the anti-shake method provided in the embodiment of the present application are similar to Figures 6 to 8 The embodiments shown are similar and will not be described again here.

[0185] In one possible case, the OIS resource also includes a timer, which obtains the jitter displacement of the camera module through the gyroscope data acquisition submodule, including: based on the timing period of the timer, periodically obtaining the jitter displacement of the camera module through the gyroscope data acquisition submodule; based on the timing period of the timer, periodically calculating and processing the jitter displacement of the camera module through the OIS algorithm submodule using a compensation algorithm to obtain a motion compensation value.

[0186] S405 , driving the motor to adjust the position and posture of the camera module based on the movement compensation value to compensate for the shaking displacement of the camera module.

[0187] In one embodiment, after receiving the operation of shutting down the camera module, the electronic device may first destroy the OIS resource and then power off the camera module. Fig.11 For details. Fig.11 As shown, the method includes:

[0188] S501: In response to a first operation, start a camera module.

[0189] S502 , providing electrical energy to the motor via the AP.

[0190] S503: The OIS module sends a first instruction to the OIS management module running in the CP, where the first instruction is used to instruct to determine the jitter displacement of the camera module and determine the movement compensation value of the motor through the CP.

[0191] Optionally, the OIS module sends a first instruction to the OIS management module running in the CP, including the following steps:

[0192] S5031: In response to the first operation, the OIS module sends a second instruction to the non-camera process management NCS module, where the second instruction is used to establish a first interface, where the first interface is a functional interface for communication between multiple processor processes;

[0193] S5032: The OIS module running in the AP sends a first instruction to the OIS management module running in the CP through the first interface.

[0194] S504: The OIS management module determines a motion compensation value in response to the first instruction.

[0195] Optionally, the OIS management module determines the motion compensation value in response to the first instruction, comprising the following steps:

[0196] S5041. The OIS management module creates OIS resources in response to the first instruction.

[0197] S5042: Determine a motion compensation value through OIS resources.

[0198] S505 , driving the motor to adjust the position and posture of the camera module based on the movement compensation value to compensate for the shaking displacement of the camera module.

[0199] S506: In response to the second operation, the OIS module running in the AP sends a third instruction to the OIS management module running in the CP.

[0200] The third instruction is used to instruct the destruction of OIS resources, and the second operation includes the operation of shutting down the camera module.

[0201] Optionally, in response to the second operation, the OIS module sends a third instruction to the OIS management module running in the CP, and sends a fifth instruction to the camera module.

[0202] The fifth instruction is used to instruct the camera module to power off after a preset time.

[0203] S507: The OIS management module destroys the OIS resources in response to the third instruction.

[0204] S508. The OIS management module sends a fourth instruction to the camera module.

[0205] The fourth instruction is used to instruct the camera module to power off. For example, the fourth instruction is an instruction instructing the camera module to power off, which is sent to the camera module by the OIS management module after the OIS resource is destroyed.

[0206] Optionally, the camera module responds to the fifth instruction and performs a power-off operation if the fourth instruction is not received within a preset time period.

[0207] The implementation principle and beneficial effects of the anti-shake method provided in the embodiment of the present application are similar to Figures 6 to 8 The embodiments shown are similar and will not be described again here.

[0208] It should be understood that, although each step in the flow chart in the above-described embodiment is shown in sequence according to the indication of the arrow, these steps are not necessarily performed in sequence according to the order indicated by the arrow. Unless there is clear explanation in this article, the execution of these steps does not have strict order restriction, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the flow chart may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these sub-steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.

[0209] It is understandable that in order to implement the above functions, the electronic device includes hardware and / or software modules corresponding to the execution of each function. In combination with the algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to be beyond the scope of the present application.

[0210] The embodiment of the present application can divide the functional modules of the electronic device according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one module. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. It should be noted that the names of the modules in the embodiment of the present application are schematic and are not limited to the names of the modules in actual implementation.

[0211] Fig.12 A schematic diagram of the structure of the anti-shake device provided in an embodiment of the present application.

[0212] It should be understood that the anti-shake device 600 can perform Figures 6 to 11 The anti-shake method shown; the anti-shake device 600 includes: an acquisition unit 610 and a processing unit 620.

[0213] The processing unit 620 is used to start the camera module in response to a first operation; provide power to the motor through AP and determine the movement compensation value of the motor through CP. The first operation includes starting the operation of the camera module; driving the motor to adjust the posture of the camera module based on the movement compensation value to compensate for the jitter displacement of the camera module.

[0214] In one embodiment, an optical image stabilization OIS module is running in the AP, and an OIS management module is running in the CP. The processing unit 620 is used for the OIS module to send a first instruction to the OIS management module running in the CP, and the first instruction is used to indicate the determination of the jitter displacement of the camera module; the OIS management module determines the motion compensation value in response to the first instruction.

[0215] In one embodiment, the processing unit 620 is used to send a second instruction to the non-camera process management NCS module in response to the first operation through the OIS module, and the second instruction is used to establish a first interface, which is a functional interface for communication between multiple processor processes; the OIS module running in the AP sends the first instruction to the OIS management module running in the CP through the first interface.

[0216] In one embodiment, the processing unit 620 is configured to create an OIS resource in response to the first instruction through the OIS management module; and determine the motion compensation value through the OIS resource.

[0217] In one embodiment, the processing unit 620 is used to obtain the jitter displacement of the camera module through the gyroscope data acquisition submodule; and calculate and process the jitter displacement of the camera module using a compensation algorithm through the OIS algorithm submodule to obtain a motion compensation value.

[0218] In one embodiment, the OIS resource also includes a timer, and the processing unit 620 is used to periodically obtain the jitter displacement of the camera module through the gyroscope data acquisition submodule based on the timing period of the timer; based on the timing period of the timer, the jitter displacement of the camera module is periodically calculated and processed by the OIS algorithm submodule using a compensation algorithm to obtain a motion compensation value.

[0219] In one embodiment, the processing unit 620 is used to send a third instruction to the OIS management module running in the CP through the OIS module running in the AP in response to the second operation, and the third instruction is used to instruct the destruction of OIS resources, and the second operation includes an operation of turning off the camera module; the OIS management module destroys the OIS resources in response to the third instruction.

[0220] In one embodiment, the processing unit 620 is used to send a fourth instruction to the camera module through the OIS management module, where the fourth instruction is used to instruct the camera module to power off.

[0221] In one embodiment, the processing unit 620 is used to respond to the second operation, send a third instruction to the OIS management module running in the CP through the OIS module, and send a fifth instruction to the camera module, wherein the fifth instruction is used to instruct the camera module to power off after a preset time.

[0222] In one embodiment, the processing unit 620 is used to respond to the fifth instruction through the camera module and perform a power-off operation if the fourth instruction is not received within a preset time period. The fourth instruction is an instruction instructing the camera module to power off after the OIS management module destroys the OIS resources.

[0223] The anti-shake device provided in this embodiment is used to execute the anti-shake method of the above embodiment, and the technical principle and technical effect are similar, which will not be repeated here.

[0224] It should be noted that the anti-shake device 600 is implemented in the form of a functional unit. The term "unit" here can be implemented in the form of software and / or hardware, and is not specifically limited to this.

[0225] For example, a "unit" may be a software program, a hardware circuit, or a combination of the two that implements the above functions. The hardware circuit may include an application specific integrated circuit (ASIC), an electronic circuit, a processor (e.g., a shared processor, a dedicated processor, or a group processor, etc.) and a memory for executing one or more software or firmware programs, a combined logic circuit, and / or other suitable components that support the described functions.

[0226] Therefore, the units of each example described in the embodiments of the present application can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present application.

[0227] Fig.13 A structural schematic diagram of an electronic device provided by the present application is shown. Fig.13 The dotted line in the figure indicates that the unit or the module is optional. The electronic device 700 can be used to implement the anti-shake method described in the above method embodiment.

[0228] The electronic device 700 includes one or more processors 701, which can support the electronic device 700 to implement the anti-shake method in the method embodiment. The processor 701 can be a general-purpose processor or a special-purpose processor. For example, the processor 701 can be a central processing unit (CPU), a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, such as discrete gates, transistor logic devices, or discrete hardware components.

[0229] The processor 701 may be used to control the electronic device 700, execute software programs, and process data of the software programs. The electronic device 700 may also include a communication unit 705 to implement input (reception) and output (transmission) of signals.

[0230] For example, the electronic device 700 may be a chip, the communication unit 705 may be an input and / or output circuit of the chip, or the communication unit 705 may be a communication interface of the chip, and the chip may be a component of a terminal device or other electronic devices.

[0231] For another example, the electronic device 700 may be a terminal device, and the communication unit 705 may be a transceiver of the terminal device, or the communication unit 705 may be a transceiver circuit of the terminal device.

[0232] The electronic device 700 may include one or more memories 702 on which a program 704 is stored. The program 704 can be executed by the processor 701 to generate instructions 703, so that the processor 701 executes the impedance matching method described in the above method embodiment according to the instructions 703.

[0233] Optionally, data may be stored in the memory 702. Optionally, the processor 701 may read data stored in the memory 702. The data may be stored at the same storage address as the program 704, or may be stored at a different storage address than the program 704.

[0234] The processor 701 and the memory 702 may be provided separately or integrated together; for example, integrated on a system on chip (SOC) of a terminal device.

[0235] Exemplarily, the memory 702 can be used to store the related program 704 of the anti-shake method provided in the embodiment of the present application, and the processor 701 can be used to call the related program 704 of the anti-shake method stored in the memory 702 when performing layer synthesis, and execute the anti-shake method of the embodiment of the present application; including: in response to a first operation, starting the camera module; providing power to the motor through the AP, and determining the movement compensation value of the motor through the CP, the first operation including starting the operation of the camera module; driving the motor to adjust the posture of the camera module based on the movement compensation value to compensate for the jitter displacement of the camera module.

[0236] The present application also provides a computer program product, which, when executed by the processor 701, implements the anti-shake method described in any method embodiment of the present application.

[0237] The computer program product may be stored in the memory 702 , for example, a program 704 , which is converted into an executable target file that can be executed by the processor 701 after preprocessing, compiling, assembling, and linking.

[0238] The present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a computer, the anti-shake method described in any method embodiment of the present application is implemented. The computer program can be a high-level language program or an executable target program.

[0239] The computer-readable storage medium is, for example, a memory 702. The memory 702 may be a volatile memory or a nonvolatile memory, or the memory 702 may include both a volatile memory and a nonvolatile memory. Among them, the nonvolatile memory may 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 may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).

[0240] In this application, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can be represented by: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.

[0241] It should be understood that in the various 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.

[0242] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

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

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

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

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

[0247] 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. An anti-shake method, characterized in that: The method is applied to an electronic device, the electronic device includes an application processor AP, a coprocessor CP and a camera module, the camera module includes a motor, and an application in the electronic device runs in the AP. The method includes: In response to a first operation, starting the camera module; Providing electric energy to the motor through the AP and determining a movement compensation value of the motor through the CP, wherein the first operation includes starting an operation of the camera module; The motor is driven to adjust the posture of the camera module based on the movement compensation value to compensate for the shaking displacement of the camera module.

2. The anti-shake method according to claim 1, characterized in that: The AP runs an optical image stabilization OIS module, the CP runs an OIS management module, and determining the movement compensation value of the motor through the CP includes: The OIS module sends a first instruction to the OIS management module running in the CP, where the first instruction is used to instruct to determine the jitter displacement of the camera module; The OIS management module determines the motion compensation value in response to the first instruction.

3. The anti-shake method according to claim 2, characterized in that: The OIS module sends a first instruction to the OIS management module running in the CP in response to the first operation, including: In response to the first operation, the OIS module sends a second instruction to the non-camera process management NCS module, where the second instruction is used to establish a first interface, where the first interface is a functional interface for communication between multi-processor processes; The OIS module running in the AP sends the first instruction to the OIS management module running in the CP through the first interface.

4. The method according to claim 2 or 3, characterized in that: The OIS management module determines the motion compensation value in response to the first instruction, including: The OIS management module creates an OIS resource in response to the first instruction; The motion compensation value is determined by the OIS resource.

5. The method according to claim 4, characterized in that The OIS resource includes an OIS algorithm submodule and a gyroscope data acquisition submodule, and determining the motion compensation value through the OIS resource includes: Acquire the jitter displacement of the camera module through the gyroscope data acquisition submodule; The OIS algorithm submodule uses a compensation algorithm to calculate and process the jitter displacement of the camera module to obtain the movement compensation value.

6. The method according to claim 5, characterized in that The OIS resource also includes a timer, and the acquiring the jitter displacement of the camera module through the gyroscope data acquisition submodule includes: Based on the timing period of the timer, periodically acquiring the jitter displacement of the camera module through the gyroscope data acquisition submodule; Based on the timing period of the timer, the OIS algorithm submodule periodically calculates and processes the jitter displacement of the camera module using a compensation algorithm to obtain the motion compensation value.

7. The method according to any one of claims 4 to 6, characterized in that: The method further comprises: In response to the second operation, the OIS module running in the AP sends a third instruction to the OIS management module running in the CP, wherein the third instruction is used to instruct to destroy the OIS resources, and the second operation includes an operation of shutting down the camera module; The OIS management module destroys the OIS resource in response to the third instruction.

8. The method according to claim 7, characterized in that After the OIS management module destroys the OIS resource in response to the third instruction, the method further includes: The OIS management module sends a fourth instruction to the camera module, where the fourth instruction is used to instruct the camera module to power off.

9. The method according to claim 7 or 8, characterized in that: In response to the second operation, the OIS module sends a third instruction to the OIS management module running in the CP, including: In response to the second operation, the OIS module sends the third instruction to the OIS management module running in the CP, and sends a fifth instruction to the camera module, where the fifth instruction is used to instruct the camera module to power off after a preset time period.

10. The method according to claim 9, characterized in that The method further comprises: The camera module responds to the fifth instruction and powers off if the fourth instruction is not received within the preset time period. The fourth instruction is an instruction sent to the camera module to instruct the camera module to power off after the OIS management module destroys the OIS resources.

11. An electronic device, characterized in that: The electronic device comprises a module for executing the method according to any one of claims 1 to 10.

12. An electronic device, characterized in that: include: one or more processors; Memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and when the computer programs are executed by the one or more processors, the electronic device performs the method according to any one of claims 1 to 10.

13. A chip system, characterized in that: The chip system includes a processor for calling and running a computer program from a memory, so that an electronic device equipped with the chip system executes the method according to any one of claims 1 to 10.

14. A computer-readable storage medium comprising a computer program, characterized in that: When the computer program is executed on an electronic device, the electronic device is enabled to execute the method according to any one of claims 1 to 10.